Skip to content

Commit

Permalink
Add back forwarding func to deduplicate doc comments
Browse files Browse the repository at this point in the history
As of Go 1.13 this can be inlined so it doesn't add overhead.

Fixes #22.
  • Loading branch information
cespare committed Nov 19, 2020
1 parent 9160c38 commit 3520c1e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions xxhash.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import (
"math/bits"
)

// Sum64 computes the 64-bit xxHash digest of b.
func Sum64(b []byte) uint64 { return sum64(b) }

const (
prime1 uint64 = 11400714785074694791
prime2 uint64 = 14029467366897019727
Expand Down
4 changes: 1 addition & 3 deletions xxhash_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

package xxhash

// Sum64 computes the 64-bit xxHash digest of b.
//
//go:noescape
func Sum64(b []byte) uint64
func sum64(b []byte) uint64

//go:noescape
func writeBlocks(d *Digest, b []byte) int
4 changes: 2 additions & 2 deletions xxhash_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
IMULQ R13, acc \
ADDQ R15, acc

// func Sum64(b []byte) uint64
TEXT ·Sum64(SB), NOSPLIT, $0-32
// func sum64(b []byte) uint64
TEXT ·sum64(SB), NOSPLIT, $0-32
// Load fixed primes.
MOVQ ·prime1v(SB), R13
MOVQ ·prime2v(SB), R14
Expand Down
3 changes: 1 addition & 2 deletions xxhash_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

package xxhash

// Sum64 computes the 64-bit xxHash digest of b.
func Sum64(b []byte) uint64 {
func sum64(b []byte) uint64 {
// A simpler version would be
// d := New()
// d.Write(b)
Expand Down

0 comments on commit 3520c1e

Please sign in to comment.