mirror of
https://github.com/exoticorn/upkr.git
synced 2026-01-20 19:46:42 +01:00
add --eof-in-length option
This commit is contained in:
@@ -21,7 +21,7 @@ pub fn pack(
|
||||
if let Some(m) = match_finder.matches(pos).next() {
|
||||
let max_offset = 1 << (m.length * 3 - 1).min(31);
|
||||
let offset = pos - m.pos;
|
||||
if offset < max_offset {
|
||||
if offset < max_offset && m.length >= config.min_length() {
|
||||
lz::Op::Match {
|
||||
offset: offset as u32,
|
||||
len: m.length as u32,
|
||||
@@ -40,7 +40,7 @@ pub fn pack(
|
||||
.zip(data[(pos - offset)..].iter())
|
||||
.take_while(|(a, b)| a == b)
|
||||
.count();
|
||||
if length > 0 {
|
||||
if length >= config.min_length() {
|
||||
lz::Op::Match {
|
||||
offset: offset as u32,
|
||||
len: length as u32,
|
||||
|
||||
Reference in New Issue
Block a user