Commit 4d3b9d97 authored by Ivan Krasin's avatar Ivan Krasin Committed by Russ Cox

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

R=rsc
CC=golang-dev
https://golang.org/cl/5556077
parent 68daa41d
...@@ -112,7 +112,7 @@ func (d *compressor) fillDeflate(b []byte) int { ...@@ -112,7 +112,7 @@ func (d *compressor) fillDeflate(b []byte) int {
d.hashHead[i] = v d.hashHead[i] = v
} }
for i, h := range d.hashPrev { for i, h := range d.hashPrev {
v := -h - windowSize v := h - windowSize
if v < -1 { if v < -1 {
v = -1 v = -1
} }
......
...@@ -291,7 +291,7 @@ var deflateInflateStringTests = []deflateInflateStringTest{ ...@@ -291,7 +291,7 @@ var deflateInflateStringTests = []deflateInflateStringTest{
{ {
"../testdata/Mark.Twain-Tom.Sawyer.txt", "../testdata/Mark.Twain-Tom.Sawyer.txt",
"Mark.Twain-Tom.Sawyer", "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},
}, },
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment