Skip to content

Commit

Permalink
Remove some casts that are now unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpane authored and folkertdev committed Jan 3, 2025
1 parent d8f24ed commit b3ec5d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions zlib-rs/src/deflate/algorithm/medium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn deflate_medium(stream: &mut DeflateStream, flush: DeflateFlush) -> BlockS
crate::deflate::longest_match::longest_match(state, hash_head);
state.match_start = match_start;
current_match.match_length = match_length as u16;
current_match.match_start = match_start as u16;
current_match.match_start = match_start;
if (current_match.match_length as usize) < WANT_MIN_MATCH {
current_match.match_length = 1;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ pub fn deflate_medium(stream: &mut DeflateStream, flush: DeflateFlush) -> BlockS
crate::deflate::longest_match::longest_match(state, hash_head);
state.match_start = match_start;
next_match.match_length = match_length as u16;
next_match.match_start = match_start as u16;
next_match.match_start = match_start;

if next_match.match_start >= next_match.strstart {
/* this can happen due to some restarts */
Expand Down
2 changes: 1 addition & 1 deletion zlib-rs/src/deflate/algorithm/slow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn deflate_slow(stream: &mut DeflateStream, flush: DeflateFlush) -> BlockSta
};

// Find the longest match, discarding those <= prev_length.
state.prev_match = state.match_start as u16;
state.prev_match = state.match_start;
match_len = STD_MIN_MATCH - 1;
dist = state.strstart as isize - hash_head as isize;

Expand Down

0 comments on commit b3ec5d9

Please sign in to comment.