Skip to content

Commit

Permalink
Remove pre-Go1.9 fallback code
Browse files Browse the repository at this point in the history
Go 1.12beta1 is out and even Appengine's oldest runtime is Go 1.9,
so get rid of pre-1.9 fallback code and always use math/bits.
  • Loading branch information
cespare committed Jan 4, 2019
1 parent 733af8e commit 7052e46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
14 changes: 0 additions & 14 deletions rotate.go

This file was deleted.

14 changes: 0 additions & 14 deletions rotate19.go

This file was deleted.

10 changes: 10 additions & 0 deletions xxhash.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package xxhash

import (
"encoding/binary"
"math/bits"
)

const (
Expand Down Expand Up @@ -173,3 +174,12 @@ func mergeRound(acc, val uint64) uint64 {
acc = acc*prime1 + prime4
return acc
}

func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) }
func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) }
func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }

0 comments on commit 7052e46

Please sign in to comment.