Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frac/sealed/token/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ func (tp *Provider) findInBlocks(firstTID, lastTID uint32, search func(*Block, i
var tids []uint32

for _, entry := range tp.entries {
if !entry.checkTIDsInBlock(firstTID, lastTID) {
continue
}

block := tp.findBlock(entry.BlockIndex)
firstIndex, lastIndex := entry.narrowIndexes(firstTID, lastTID)
indexes, err := search(block, firstIndex, lastIndex)
Expand Down
12 changes: 12 additions & 0 deletions frac/sealed/token/table_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ func (t *TableEntry) narrowIndexes(firstTID, lastTID uint32) (int, int) {
return firstIndex, lastIndex
}

func (t *TableEntry) checkTIDsInBlock(firstTID, lastTID uint32) bool {
if lastTID < t.StartTID {
return false
}

if firstTID > t.getLastTID() {
return false
}

return true
}

func (t *TableEntry) checkTIDInBlock(tid uint32) bool {
if tid < t.StartTID {
return false
Expand Down
Loading