summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/net/publicsuffix/list.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2022-11-08 11:30:29 +0100
committerLibravatar GitHub <noreply@github.com>2022-11-08 11:30:29 +0100
commitbe011b164168ae5c1ae7b8a0c11c392187701766 (patch)
tree4ea275ab207ec4724a71f2c327034065589a5402 /vendor/golang.org/x/net/publicsuffix/list.go
parent[chore]: Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#1002) (diff)
downloadgotosocial-be011b164168ae5c1ae7b8a0c11c392187701766.tar.xz
[chore]: Bump github.com/spf13/viper from 1.13.0 to 1.14.0 (#1003)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.13.0 to 1.14.0. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.13.0...v1.14.0) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/golang.org/x/net/publicsuffix/list.go')
-rw-r--r--vendor/golang.org/x/net/publicsuffix/list.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/vendor/golang.org/x/net/publicsuffix/list.go b/vendor/golang.org/x/net/publicsuffix/list.go
index e2fddd645..7caeeaa69 100644
--- a/vendor/golang.org/x/net/publicsuffix/list.go
+++ b/vendor/golang.org/x/net/publicsuffix/list.go
@@ -101,7 +101,7 @@ loop:
break
}
- u := nodes[f] >> (nodesBitsTextOffset + nodesBitsTextLength)
+ u := uint32(nodeValue(f) >> (nodesBitsTextOffset + nodesBitsTextLength))
icannNode = u&(1<<nodesBitsICANN-1) != 0
u >>= nodesBitsICANN
u = children[u&(1<<nodesBitsChildren-1)]
@@ -154,9 +154,18 @@ func find(label string, lo, hi uint32) uint32 {
return notFound
}
+func nodeValue(i uint32) uint64 {
+ off := uint64(i * (nodesBits / 8))
+ return uint64(nodes[off])<<32 |
+ uint64(nodes[off+1])<<24 |
+ uint64(nodes[off+2])<<16 |
+ uint64(nodes[off+3])<<8 |
+ uint64(nodes[off+4])
+}
+
// nodeLabel returns the label for the i'th node.
func nodeLabel(i uint32) string {
- x := nodes[i]
+ x := nodeValue(i)
length := x & (1<<nodesBitsTextLength - 1)
x >>= nodesBitsTextLength
offset := x & (1<<nodesBitsTextOffset - 1)