From: Joe Tsai Date: Sun, 29 May 2016 07:47:45 +0000 (-0700) Subject: compress/flate: use seperate const block for exported constants X-Git-Tag: go1.7beta1~32 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7cd6cae6a63f09caa88bbcc394053b40cdeeccd1;p=gostls13.git compress/flate: use seperate const block for exported constants As rendered on https://tip.golang.org/pkg/compress/flate/, there is an extra new-line because of the unexported constants in the same block. <<< const ( NoCompression = 0 BestSpeed = 1 BestCompression = 9 DefaultCompression = -1 HuffmanOnly = -2 // Disables match search and only does Huffman entropy reduction. ) >>> Instead, seperate the exported compression level constants into its own const block. This is both more readable and also fixes the issue. Change-Id: I60b7966c83fb53356c02e4640d05f55a3bee35b7 Reviewed-on: https://go-review.googlesource.com/23557 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- diff --git a/src/compress/flate/deflate.go b/src/compress/flate/deflate.go index 8467d7749d..8a085ba347 100644 --- a/src/compress/flate/deflate.go +++ b/src/compress/flate/deflate.go @@ -16,9 +16,12 @@ const ( BestCompression = 9 DefaultCompression = -1 HuffmanOnly = -2 // Disables match search and only does Huffman entropy reduction. - logWindowSize = 15 - windowSize = 1 << logWindowSize - windowMask = windowSize - 1 +) + +const ( + logWindowSize = 15 + windowSize = 1 << logWindowSize + windowMask = windowSize - 1 // The LZ77 step produces a sequence of literal tokens and // pair tokens. The offset is also known as distance. The underlying wire