1
0
mirror of https://github.com/golang/go synced 2024-11-24 22:47:58 -07:00

compress/flate: fix a typo, improve compression rate by 3-4%.

R=rsc
CC=golang-dev
https://golang.org/cl/5556077
This commit is contained in:
Ivan Krasin 2012-01-21 12:18:15 -05:00 committed by Russ Cox
parent 68daa41d1b
commit 4d3b9d9757
2 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ func (d *compressor) fillDeflate(b []byte) int {
d.hashHead[i] = v
}
for i, h := range d.hashPrev {
v := -h - windowSize
v := h - windowSize
if v < -1 {
v = -1
}

View File

@ -291,7 +291,7 @@ var deflateInflateStringTests = []deflateInflateStringTest{
{
"../testdata/Mark.Twain-Tom.Sawyer.txt",
"Mark.Twain-Tom.Sawyer",
[...]int{416188, 191483, 185232, 179560, 175233, 171263, 169908, 169758, 169712, 169712},
[...]int{407330, 187598, 180361, 172974, 169160, 163476, 160936, 160506, 160295, 160295},
},
}