Commit ef46ee45 authored by Adam Blank's avatar Adam Blank
Browse files

Minor fix to extendMatch

parent 7db43c2b
......@@ -106,8 +106,9 @@ public class SuffixTrie extends HashTrieMap<Byte, ByteString, Boolean> {
// Note: this method has been provided for you. You should not make any
// changes to this method.
int numMatches = 0;
while (buffer.hasWork() && !this.currentMatch.isFull() &&
this.currentMatch.peek(numMatches) == buffer.peek()) {
while (buffer.hasWork() &&
this.currentMatch.size() <= this.currentMatch.capacity() - 1 &&
this.currentMatch.peek(numMatches) == buffer.peek()) {
this.currentMatch.add(buffer.next());
numMatches += 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment