some more debug rollsum info

This commit is contained in:
Brad Fitzpatrick 2011-06-04 17:44:24 -07:00
parent e7dbdfef43
commit 99f79ed8b5
1 changed files with 9 additions and 1 deletions

View File

@ -368,6 +368,8 @@ func showSplits() {
rs := rollsum.New()
n := 0
lastSplit := map[int]int{}
last := 0
for {
c, err := bufr.ReadByte()
if err != nil {
@ -379,7 +381,13 @@ func showSplits() {
n++
rs.Roll(c)
if rs.OnSplit() {
log.Printf("split at %d, bits=%d", n, rs.Bits())
bits := rs.Bits()
log.Printf("split at %d (after %d), bits=%d", n, n - last, bits)
last = n
for bits, last := range lastSplit {
log.Printf(" since %d = %d", bits, n - last)
}
lastSplit[bits] = n
}
}