1
0
mirror of https://github.com/golang/go synced 2024-11-17 17:34:46 -07:00

hash/crc32: rename iEEETable to ieeeTable

iEEETable violates the Go naming conventions and is inconsistent
with the rest of the package. Use ieeeTable instead.

Change-Id: I04b201aa39759d159de2b0295f43da80488c2263
Reviewed-on: https://go-review.googlesource.com/17068
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Joe Tsai 2015-11-19 17:36:59 -08:00 committed by Brad Fitzpatrick
parent ec3daf0c62
commit d6ee6c2d06
4 changed files with 12 additions and 12 deletions

View File

@ -57,9 +57,9 @@ var IEEETable = makeTable(IEEE)
// slicing8Table is array of 8 Tables // slicing8Table is array of 8 Tables
type slicing8Table [8]Table type slicing8Table [8]Table
// iEEETable8 is the slicing8Table for IEEE // ieeeTable8 is the slicing8Table for IEEE
var iEEETable8 *slicing8Table var ieeeTable8 *slicing8Table
var iEEETable8Once sync.Once var ieeeTable8Once sync.Once
// MakeTable returns a Table constructed from the specified polynomial. // MakeTable returns a Table constructed from the specified polynomial.
// The contents of this Table must not be modified. // The contents of this Table must not be modified.

View File

@ -44,10 +44,10 @@ func updateIEEE(crc uint32, p []byte) uint32 {
// only use slicing-by-8 when input is >= 4KB // only use slicing-by-8 when input is >= 4KB
if len(p) >= 4096 { if len(p) >= 4096 {
iEEETable8Once.Do(func() { ieeeTable8Once.Do(func() {
iEEETable8 = makeTable8(IEEE) ieeeTable8 = makeTable8(IEEE)
}) })
return updateSlicingBy8(crc, iEEETable8, p) return updateSlicingBy8(crc, ieeeTable8, p)
} }
return update(crc, IEEETable, p) return update(crc, IEEETable, p)

View File

@ -27,10 +27,10 @@ func updateCastagnoli(crc uint32, p []byte) uint32 {
func updateIEEE(crc uint32, p []byte) uint32 { func updateIEEE(crc uint32, p []byte) uint32 {
// only use slicing-by-8 when input is >= 4KB // only use slicing-by-8 when input is >= 4KB
if len(p) >= 4096 { if len(p) >= 4096 {
iEEETable8Once.Do(func() { ieeeTable8Once.Do(func() {
iEEETable8 = makeTable8(IEEE) ieeeTable8 = makeTable8(IEEE)
}) })
return updateSlicingBy8(crc, iEEETable8, p) return updateSlicingBy8(crc, ieeeTable8, p)
} }
return update(crc, IEEETable, p) return update(crc, IEEETable, p)

View File

@ -16,10 +16,10 @@ func updateCastagnoli(crc uint32, p []byte) uint32 {
func updateIEEE(crc uint32, p []byte) uint32 { func updateIEEE(crc uint32, p []byte) uint32 {
// only use slicing-by-8 when input is >= 4KB // only use slicing-by-8 when input is >= 4KB
if len(p) >= 4096 { if len(p) >= 4096 {
iEEETable8Once.Do(func() { ieeeTable8Once.Do(func() {
iEEETable8 = makeTable8(IEEE) ieeeTable8 = makeTable8(IEEE)
}) })
return updateSlicingBy8(crc, iEEETable8, p) return updateSlicingBy8(crc, ieeeTable8, p)
} }
return update(crc, IEEETable, p) return update(crc, IEEETable, p)
} }