Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
599 B
Go
35 lines
599 B
Go
// Copyright 2019+ Klaus Post. All rights reserved.
|
|
// License information can be found in the LICENSE file.
|
|
|
|
package flate
|
|
|
|
import (
|
|
"math/bits"
|
|
|
|
"github.com/klauspost/compress/internal/le"
|
|
)
|
|
|
|
// 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) {
|
|
left := len(a)
|
|
for left >= 8 {
|
|
diff := le.Load64(a, n) ^ le.Load64(b, n)
|
|
if diff != 0 {
|
|
return n + bits.TrailingZeros64(diff)>>3
|
|
}
|
|
n += 8
|
|
left -= 8
|
|
}
|
|
|
|
a = a[n:]
|
|
b = b[n:]
|
|
for i := range a {
|
|
if a[i] != b[i] {
|
|
break
|
|
}
|
|
n++
|
|
}
|
|
return n
|
|
}
|