aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/net/idna/trie13.0.0.go
diff options
context:
space:
mode:
authorLibravatar Rutger Broekhoff2023-12-29 21:31:53 +0100
committerLibravatar Rutger Broekhoff2023-12-29 21:31:53 +0100
commit404aeae4545d2426c089a5f8d5e82dae56f5212b (patch)
tree2d84e00af272b39fc04f3795ae06bc48970e57b5 /vendor/golang.org/x/net/idna/trie13.0.0.go
parent209d8b0187ed025dec9ac149ebcced3462877bff (diff)
downloadgitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.tar.gz
gitolfs3-404aeae4545d2426c089a5f8d5e82dae56f5212b.zip
Make Nix builds work
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.go30
1 files changed, 30 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 0000000..fa45bb9
--- /dev/null
+++ b/vendor/golang.org/x/net/idna/trie13.0.0.go
@@ -0,0 +1,30 @@
1// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2
3// Copyright 2016 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7//go:build go1.16
8
9package idna
10
11// appendMapping appends the mapping for the respective rune. isMapped must be
12// true. A mapping is a categorization of a rune as defined in UTS #46.
13func (c info) appendMapping(b []byte, s string) []byte {
14 index := int(c >> indexShift)
15 if c&xorBit == 0 {
16 p := index
17 return append(b, mappings[mappingIndex[p]:mappingIndex[p+1]]...)
18 }
19 b = append(b, s...)
20 if c&inlineXOR == inlineXOR {
21 // TODO: support and handle two-byte inline masks
22 b[len(b)-1] ^= byte(index)
23 } else {
24 for p := len(b) - int(xorData[index]); p < len(b); p++ {
25 index++
26 b[p] ^= xorData[index]
27 }
28 }
29 return b
30}