Source File
find_match_length.go
Belonging Package
github.com/andybalholm/brotli
package brotli
import (
)
/* Copyright 2010 Google Inc. All Rights Reserved.
Distributed under MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
/* Function to find maximal matching prefixes of strings. */
func findMatchLengthWithLimit( []byte, []byte, uint) uint {
var uint = 0
_, _ = [-1], [-1] // bounds check
switch runtime.GOARCH {
case "amd64":
// Compare 8 bytes at at time.
for +8 <= {
:= binary.LittleEndian.Uint64([:])
:= binary.LittleEndian.Uint64([:])
if != {
return + uint(bits.TrailingZeros64(^)>>3)
}
+= 8
}
case "386":
// Compare 4 bytes at at time.
for +4 <= {
:= binary.LittleEndian.Uint32([:])
:= binary.LittleEndian.Uint32([:])
if != {
return + uint(bits.TrailingZeros32(^)>>3)
}
+= 4
}
}
for < && [] == [] {
++
}
return
}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |