Skip to content

Commit

Permalink
moved maxUint64/32 out of the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabe committed Apr 17, 2024
1 parent 84c80ca commit dbca997
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions table.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var factors = [...]uint64{

const factorsCount = len(factors)

const maxUint64 = ^uint64(0)
const maxUint32 = ^uint32(0)

var lookup32 [32]uint32
var lookup64 [64]uint64

Expand All @@ -33,8 +36,6 @@ func init() {
}

func buildLookup32() {
const maxUint32 = ^uint32(0)

/*
lookup32 table
Expand Down Expand Up @@ -94,8 +95,6 @@ func buildLookup64() {
10 18446744073709551615 18446744073709551615 18446744073709551615
*/

const maxUint64 = ^uint64(0)

for i, j := 0, 0; i < factorsCount; i++ {
lookup64[j] = factors[i]
lookup64[j+1] = maxUint64
Expand Down

0 comments on commit dbca997

Please sign in to comment.