@@ -51,24 +51,24 @@ func (x *Index) Close() error {
5151
5252func (x * Index ) ReadStateFor (blot uint16 ) * ReadState {
5353 /*
54- refCount := x.counts[blot]
55- i := sort.Search(1<<16, func(i int) bool {
56- return x.counts[x.perm[i]] > refCount
57- })
58- if i == len(x.perm) {
59- panic("internal error in perm/count")
60- }
61- if x.perm[i] != blot {
62- fmt.Printf("blot %x i %d perm[%d] %x count %d ref %d %#v\n", blot, i, i, x.perm[i], x.counts[x.perm[i]], refCount, x.perm[i-1:i+2])
63- panic("internal error2 in perm/count")
64- }
54+ broken still
55+ refCount := x.counts[blot]
56+ i := sort.Search(1<<16, func(i int) bool {
57+ return x.counts[x.perm[i]] > refCount
58+ })
59+ if i == len(x.perm) {
60+ panic("internal error in perm/count")
61+ }
62+ if x.perm[i] != blot {
63+ fmt.Printf("blot %x i %d perm[%d] %x count %d ref %d %#v\n", blot, i, i, x.perm[i], x.counts[x.perm[i]], refCount, x.perm[i-1:i+2])
64+ panic("internal error2 in perm/count")
65+ }
6566 */
6667 return x .ReadStateForBlotAt (blot , 0 ) //uint16(i))
6768}
6869
6970func (x * Index ) ReadStateForBlotAt (blot , at uint16 ) * ReadState {
7071 res := & ReadState {}
71- fmt .Printf ("head of shard blot %x is %d\n " , blot , x .heads [blot ])
7272 res .Posts = newPosts (x .heads [blot ])
7373 res .Shard = x .id
7474 res .Blot = blot
@@ -111,9 +111,6 @@ func (x *Index) readIix() error {
111111 if err != nil {
112112 return err
113113 }
114- if i == 0xf974 {
115- fmt .Printf ("0xf974: head %d count %d\n " , hd , ct )
116- }
117114 x .counts [i ] = uint32 (ct )
118115 x .perm [i ] = uint16 (i )
119116 }
0 commit comments