aboutsummaryrefslogtreecommitdiff
path: root/src/compress
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2018-05-07 11:25:28 -0400
committerRuss Cox <rsc@golang.org>2018-05-07 15:42:46 +0000
commitd474f582fed7c9b6bc78deee3d09f77b4c8af9ad (patch)
tree30c20f2765d9533b781c5397d43ab457ee43bd19 /src/compress
parent9d72e8c686a6e446fbf39d5b6c9cec49f0713282 (diff)
downloadgo-d474f582fed7c9b6bc78deee3d09f77b4c8af9ad.tar.gz
go-d474f582fed7c9b6bc78deee3d09f77b4c8af9ad.zip
compress/flate: do not rename math/bits import
Makes compress/flate work better with cmd/dist bootstrap. Change-Id: Ifc7d74027367008e82c1d14ec77141830583ba82 Reviewed-on: https://go-review.googlesource.com/111815 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/compress')
-rw-r--r--src/compress/flate/inflate.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compress/flate/inflate.go b/src/compress/flate/inflate.go
index d2b471f715..25e81f3f72 100644
--- a/src/compress/flate/inflate.go
+++ b/src/compress/flate/inflate.go
@@ -10,7 +10,7 @@ package flate
import (
"bufio"
"io"
- mathbits "math/bits"
+ "math/bits"
"strconv"
"sync"
)
@@ -113,7 +113,7 @@ type huffmanDecoder struct {
// tree (i.e., neither over-subscribed nor under-subscribed). The exception is a
// degenerate case where the tree has only a single symbol with length 1. Empty
// trees are permitted.
-func (h *huffmanDecoder) init(bits []int) bool {
+func (h *huffmanDecoder) init(lengths []int) bool {
// Sanity enables additional runtime tests during Huffman
// table construction. It's intended to be used during
// development to supplement the currently ad-hoc unit tests.
@@ -127,7 +127,7 @@ func (h *huffmanDecoder) init(bits []int) bool {
// compute min and max length.
var count [maxCodeLen]int
var min, max int
- for _, n := range bits {
+ for _, n := range lengths {
if n == 0 {
continue
}
@@ -177,7 +177,7 @@ func (h *huffmanDecoder) init(bits []int) bool {
link := nextcode[huffmanChunkBits+1] >> 1
h.links = make([][]uint32, huffmanNumChunks-link)
for j := uint(link); j < huffmanNumChunks; j++ {
- reverse := int(mathbits.Reverse16(uint16(j)))
+ reverse := int(bits.Reverse16(uint16(j)))
reverse >>= uint(16 - huffmanChunkBits)
off := j - uint(link)
if sanity && h.chunks[reverse] != 0 {
@@ -188,14 +188,14 @@ func (h *huffmanDecoder) init(bits []int) bool {
}
}
- for i, n := range bits {
+ for i, n := range lengths {
if n == 0 {
continue
}
code := nextcode[n]
nextcode[n]++
chunk := uint32(i<<huffmanValueShift | n)
- reverse := int(mathbits.Reverse16(uint16(code)))
+ reverse := int(bits.Reverse16(uint16(code)))
reverse >>= uint(16 - n)
if n <= huffmanChunkBits {
for off := reverse; off < len(h.chunks); off += 1 << uint(n) {
@@ -557,7 +557,7 @@ readLiteral:
return
}
}
- dist = int(mathbits.Reverse8(uint8(f.b & 0x1F << 3)))
+ dist = int(bits.Reverse8(uint8(f.b & 0x1F << 3)))
f.b >>= 5
f.nb -= 5
} else {