diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-06-06 02:49:26 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-06-06 02:49:26 +0200 |
commit | 746a09a5854b9ce17e40caead51e1a42c2721bb1 (patch) | |
tree | 474d9a11c3b82196577b61333dffe3c94c5258fb /vendor/golang.org/x/text/internal/language/compact.go | |
parent | efa0bd7df5f51d47c50efc446fd2f32996ab79be (diff) |
Unvendor dependencies
Diffstat (limited to 'vendor/golang.org/x/text/internal/language/compact.go')
-rw-r--r-- | vendor/golang.org/x/text/internal/language/compact.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/vendor/golang.org/x/text/internal/language/compact.go b/vendor/golang.org/x/text/internal/language/compact.go deleted file mode 100644 index 46a0015..0000000 --- a/vendor/golang.org/x/text/internal/language/compact.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -// CompactCoreInfo is a compact integer with the three core tags encoded. -type CompactCoreInfo uint32 - -// GetCompactCore generates a uint32 value that is guaranteed to be unique for -// different language, region, and script values. -func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { - if t.LangID > langNoIndexOffset { - return 0, false - } - cci |= CompactCoreInfo(t.LangID) << (8 + 12) - cci |= CompactCoreInfo(t.ScriptID) << 12 - cci |= CompactCoreInfo(t.RegionID) - return cci, true -} - -// Tag generates a tag from c. -func (c CompactCoreInfo) Tag() Tag { - return Tag{ - LangID: Language(c >> 20), - RegionID: Region(c & 0x3ff), - ScriptID: Script(c>>12) & 0xff, - } -} |