make packer usable as lib

This commit is contained in:
2021-11-20 16:27:35 +01:00
parent 8f23ec711f
commit 479a2e2c89
5 changed files with 30 additions and 16 deletions

View File

@@ -113,7 +113,7 @@ impl<'a> Iterator for Matches<'a> {
self.add_to_queue(self.finder.suffixes[self.left_index]);
self.move_left();
}
if self.right_length == self.current_length {
if self.right_length == self.current_length && self.matches_left > 0 {
self.add_to_queue(self.finder.suffixes[self.right_index]);
self.move_right();
}