Skip to content

Commit

Permalink
use Ord::min to calculate state.insert
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Jan 6, 2025
1 parent 366676f commit ddc0af4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions zlib-rs/src/deflate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1738,9 +1738,7 @@ pub(crate) fn fill_window(stream: &mut DeflateStream) {

state.strstart -= wsize; /* we now have strstart >= MAX_DIST */
state.block_start -= wsize as isize;
if state.insert > state.strstart {
state.insert = state.strstart;
}
state.insert = Ord::min(state.insert, state.strstart);

self::slide_hash::slide_hash(state);

Expand Down

0 comments on commit ddc0af4

Please sign in to comment.