diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2022-08-15 11:04:03 +0200 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2022-08-18 16:16:13 +0000 |
commit | b6149224499108d4ea6e562fd9fd7eac35f50a6d (patch) | |
tree | 3a835be427c53521aa70b4292a7d3b36950b4d80 /src/hash | |
parent | c7c78f1a3a4c94043c140962f2916a69e466d255 (diff) | |
download | go-b6149224499108d4ea6e562fd9fd7eac35f50a6d.tar.gz go-b6149224499108d4ea6e562fd9fd7eac35f50a6d.zip |
hash/crc32: remove single-use {castagnoli,ieee}ArchImpl bools
These are only used once right after being set in castagnoliInit and
ieeeInit, respectively.
Change-Id: Ifc5df1fe3040b97b1d252cc6d6d28d8fbc132fa5
Reviewed-on: https://go-review.googlesource.com/c/go/+/423854
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/crc32/crc32.go | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/hash/crc32/crc32.go b/src/hash/crc32/crc32.go index f330fdb77a..1a24d980cc 100644 --- a/src/hash/crc32/crc32.go +++ b/src/hash/crc32/crc32.go @@ -76,16 +76,14 @@ type Table [256]uint32 // using this polynomial. var castagnoliTable *Table var castagnoliTable8 *slicing8Table -var castagnoliArchImpl bool var updateCastagnoli func(crc uint32, p []byte) uint32 var castagnoliOnce sync.Once var haveCastagnoli uint32 func castagnoliInit() { castagnoliTable = simpleMakeTable(Castagnoli) - castagnoliArchImpl = archAvailableCastagnoli() - if castagnoliArchImpl { + if archAvailableCastagnoli() { archInitCastagnoli() updateCastagnoli = archUpdateCastagnoli } else { @@ -104,14 +102,11 @@ var IEEETable = simpleMakeTable(IEEE) // ieeeTable8 is the slicing8Table for IEEE var ieeeTable8 *slicing8Table -var ieeeArchImpl bool var updateIEEE func(crc uint32, p []byte) uint32 var ieeeOnce sync.Once func ieeeInit() { - ieeeArchImpl = archAvailableIEEE() - - if ieeeArchImpl { + if archAvailableIEEE() { archInitIEEE() updateIEEE = archUpdateIEEE } else { |