unexport cluster's newhasher func

This commit is contained in:
Matt Jaffee 2018-07-02 17:25:21 -05:00
parent 197f491b29
commit f78af41565
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
2 changed files with 3 additions and 3 deletions

View file

@ -839,8 +839,8 @@ type Hasher interface {
Hash(key uint64, n int) int
}
// NewHasher returns a new instance of the default hasher.
func NewHasher() Hasher { return &jmphasher{} }
// newHasher returns a new instance of the default hasher.
func newHasher() Hasher { return &jmphasher{} }
// jmphasher represents an implementation of jmphash. Implements Hasher.
type jmphasher struct{}

View file

@ -373,7 +373,7 @@ func TestHasher(t *testing.T) {
{0x0ddc0ffeebadf00d, []int{0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 15, 15, 15}},
} {
for i, v := range tt.bucket {
if got := NewHasher().Hash(tt.key, i+1); got != v {
if got := newHasher().Hash(tt.key, i+1); got != v {
t.Errorf("hash(%v,%v)=%v, want %v", tt.key, i+1, got, v)
}
}