]> Cypherpunks repositories - gostls13.git/commit
hash/crc32: remove redundant code
authorErik Pellizzon <erikpellizzon1@gmail.com>
Wed, 14 Sep 2022 10:13:06 +0000 (10:13 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 15 Sep 2022 21:07:21 +0000 (21:07 +0000)
commitf6436c60e49f17f2ca723fdf76a0cb4323cbe02c
tree5ee30bbf3ac5fd4c7fcc8b8a97fc7accdc36b18f
parenta7db14241cf59f9d3bf4e1a68cf9e503e1a05211
hash/crc32: remove redundant code

Merge the CRC32 Update and Write functions using an unexported function, to avoid duplication of code and make it more readable.
The only difference between them is the check of the initialization of the IEEE table, and a boolean value specifies that.

Throughout the crc32.go file, in the switches the default value is inserted inside the switch statement, this change uniforms the style of the MakeTable function, making it like the other pieces of code.

Change-Id: I3889f6c6671210c82f0d7250cea67907bccf3ce7
GitHub-Last-Rev: b8777ee213f2ebad0bb4a5dcdb812fd356d6d086
GitHub-Pull-Request: golang/go#55044
Reviewed-on: https://go-review.googlesource.com/c/go/+/430456
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Jenny Rakoczy <jenny@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Jenny Rakoczy <jenny@golang.org>
Auto-Submit: Jenny Rakoczy <jenny@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
src/hash/crc32/crc32.go
src/hash/crc32/crc32_test.go