diff options
Diffstat (limited to 'src/cmd/vendor/golang.org/x/mod/sumdb/tlog/tile.go')
-rw-r--r-- | src/cmd/vendor/golang.org/x/mod/sumdb/tlog/tile.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cmd/vendor/golang.org/x/mod/sumdb/tlog/tile.go b/src/cmd/vendor/golang.org/x/mod/sumdb/tlog/tile.go index 857d487551..37771c5310 100644 --- a/src/cmd/vendor/golang.org/x/mod/sumdb/tlog/tile.go +++ b/src/cmd/vendor/golang.org/x/mod/sumdb/tlog/tile.go @@ -115,16 +115,14 @@ func NewTiles(h int, oldTreeSize, newTreeSize int64) []Tile { for level := uint(0); newTreeSize>>(H*level) > 0; level++ { oldN := oldTreeSize >> (H * level) newN := newTreeSize >> (H * level) + if oldN == newN { + continue + } for n := oldN >> H; n < newN>>H; n++ { tiles = append(tiles, Tile{H: h, L: int(level), N: n, W: 1 << H}) } n := newN >> H - maxW := int(newN - n<<H) - minW := 1 - if oldN > n<<H { - minW = int(oldN - n<<H) - } - for w := minW; w <= maxW; w++ { + if w := int(newN - n<<H); w > 0 { tiles = append(tiles, Tile{H: h, L: int(level), N: n, W: w}) } } |