Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ static Trie train(VarBinBytes.Rows rows) {
}
long prev = trie.longestMatch(bytes, start, end);
int pos = start + Trie.length(prev);
if (threshold.scanned(Trie.length(prev))) {
if (threshold.scan(Trie.length(prev))) {
break;
}
while (pos < end) {
long curr = trie.longestMatch(bytes, pos, end);
if (threshold.scanned(Trie.length(curr))) {
if (threshold.scan(Trie.length(curr))) {
return trie;
}
int prevLen = Trie.length(prev);
Expand Down Expand Up @@ -279,8 +279,10 @@ private static final class Threshold {
this.nextCheck = checkInterval;
}

/// Counts `n` more bytes scanned.
///
/// @return `true` once the scan budget is exhausted
boolean scanned(int n) {
boolean scan(int n) {
scanned += n;
return scanned > budget;
}
Expand Down
Loading