mirror of
https://github.com/loro-dev/loro.git
synced 2025-01-23 05:24:51 +00:00
feat(minor): add a min match size
This commit is contained in:
parent
d8b51f6acf
commit
e8ca8d61ed
1 changed files with 2 additions and 1 deletions
|
@ -97,9 +97,10 @@ impl CompactBytes {
|
|||
}
|
||||
|
||||
let mut index = 0;
|
||||
let min_match_size = 4.min(bytes.len());
|
||||
while index < bytes.len() {
|
||||
match self.lookup(&bytes[index..]) {
|
||||
Some((pos, len)) if len >= 4 => {
|
||||
Some((pos, len)) if len >= min_match_size => {
|
||||
push_with_merge(&mut ans, pos..pos + len);
|
||||
index += len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue