summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/net/idna/trie13.0.0.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-07-10 12:43:32 +0100
committerLibravatar GitHub <noreply@github.com>2023-07-10 12:43:32 +0100
commit6de5ca46f80c4e0d5bfc2df42a8d6af3757a312b (patch)
tree52b87f98db9edbe56832a669a200ee0d7220e91c /vendor/golang.org/x/net/idna/trie13.0.0.go
parent[chore]: Bump golang.org/x/image from 0.8.0 to 0.9.0 (#1972) (diff)
downloadgotosocial-6de5ca46f80c4e0d5bfc2df42a8d6af3757a312b.tar.xz
[chore]: Bump golang.org/x/net from 0.11.0 to 0.12.0 (#1973)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/golang.org/x/net/idna/trie13.0.0.go')
-rw-r--r--vendor/golang.org/x/net/idna/trie13.0.0.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/vendor/golang.org/x/net/idna/trie13.0.0.go b/vendor/golang.org/x/net/idna/trie13.0.0.go
new file mode 100644
index 000000000..7d68a8dc1
--- /dev/null
+++ b/vendor/golang.org/x/net/idna/trie13.0.0.go
@@ -0,0 +1,31 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+// Copyright 2016 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.
+
+//go:build go1.16
+// +build go1.16
+
+package idna
+
+// appendMapping appends the mapping for the respective rune. isMapped must be
+// true. A mapping is a categorization of a rune as defined in UTS #46.
+func (c info) appendMapping(b []byte, s string) []byte {
+ index := int(c >> indexShift)
+ if c&xorBit == 0 {
+ p := index
+ return append(b, mappings[mappingIndex[p]:mappingIndex[p+1]]...)
+ }
+ b = append(b, s...)
+ if c&inlineXOR == inlineXOR {
+ // TODO: support and handle two-byte inline masks
+ b[len(b)-1] ^= byte(index)
+ } else {
+ for p := len(b) - int(xorData[index]); p < len(b); p++ {
+ index++
+ b[p] ^= xorData[index]
+ }
+ }
+ return b
+}