mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-01 15:55:49 +03:00
Bumps the go-modules-updates group with 2 updates in the / directory: [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) and [golang.org/x/crypto](https://github.com/golang/crypto). Updates `github.com/prometheus/client_golang` from 1.19.1 to 1.20.2 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.19.1...v1.20.2) Updates `golang.org/x/crypto` from 0.24.0 to 0.26.0 - [Commits](https://github.com/golang/crypto/compare/v0.24.0...v0.26.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-modules-updates - dependency-name: golang.org/x/crypto dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-modules-updates ... Signed-off-by: dependabot[bot] <support@github.com>
34 lines
675 B
Go
34 lines
675 B
Go
//go:build !amd64 || appengine || !gc || noasm
|
|
// +build !amd64 appengine !gc noasm
|
|
|
|
// Copyright 2019+ Klaus Post. All rights reserved.
|
|
// License information can be found in the LICENSE file.
|
|
|
|
package zstd
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"math/bits"
|
|
)
|
|
|
|
// matchLen returns the maximum common prefix length of a and b.
|
|
// a must be the shortest of the two.
|
|
func matchLen(a, b []byte) (n int) {
|
|
for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] {
|
|
diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b)
|
|
if diff != 0 {
|
|
return n + bits.TrailingZeros64(diff)>>3
|
|
}
|
|
n += 8
|
|
}
|
|
|
|
for i := range a {
|
|
if a[i] != b[i] {
|
|
break
|
|
}
|
|
n++
|
|
}
|
|
return n
|
|
|
|
}
|