File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -473,20 +473,20 @@ func makeSparseBuckets(buckets *sync.Map) *dto.SparseBuckets {
473
473
474
474
sbs := dto.SparseBuckets {}
475
475
var prevCount uint64
476
- var prevI int
476
+ var nextI int
477
477
for n , i := range ii {
478
478
v , _ := buckets .Load (i )
479
479
count := atomic .LoadUint64 (v .(* uint64 ))
480
- if n == 0 || i - prevI != 1 {
480
+ if n == 0 || i - nextI != 0 {
481
481
sbs .Span = append (sbs .Span , & dto.SparseBuckets_Span {
482
- Offset : proto .Int (i - prevI ),
482
+ Offset : proto .Int (i - nextI ),
483
483
Length : proto .Uint32 (1 ),
484
484
})
485
485
} else {
486
486
* sbs .Span [len (sbs .Span )- 1 ].Length ++
487
487
}
488
488
sbs .Delta = append (sbs .Delta , int64 (count )- int64 (prevCount )) // TODO(beorn7): Do proper overflow handling.
489
- prevI , prevCount = i , count
489
+ nextI , prevCount = i + 1 , count
490
490
}
491
491
return & sbs
492
492
}
You can’t perform that action at this time.
0 commit comments