Skip to content

Commit 85bc778

Browse files
committed
quick algorithm quick cleanup
1 parent ecf3ae5 commit 85bc778

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

zlib-rs/src/deflate/algorithm/quick.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,13 @@ pub fn deflate_quick(stream: &mut DeflateStream, flush: DeflateFlush) -> BlockSt
133133
state.lookahead -= 1;
134134
}
135135

136-
state.insert = if state.strstart < (STD_MIN_MATCH - 1) {
137-
state.strstart
138-
} else {
139-
STD_MIN_MATCH - 1
140-
};
136+
state.insert = Ord::min(state.strstart, STD_MIN_MATCH - 1);
137+
138+
quick_end_block!();
141139

142140
if last {
143-
quick_end_block!();
144-
return BlockState::FinishDone;
141+
BlockState::FinishDone
142+
} else {
143+
BlockState::BlockDone
145144
}
146-
147-
quick_end_block!();
148-
BlockState::BlockDone
149145
}

0 commit comments

Comments
 (0)