Skip to content

Commit

Permalink
Fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed May 21, 2024
1 parent 885d17c commit 6bd20b1
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/legacy/shrink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,17 @@ fn read_code<T: std::io::Read, E: Endianness>(
}

// Handle control codes.
let control_code = if let Ok(c) = is.read::<u16>(*code_size as u32) {
c
} else {
return Ok(None);
};
if control_code == INC_CODE_SIZE && *code_size < MAX_CODE_SIZE {
(*code_size) += 1;
return read_code(is, code_size, codetab, queue);
}
if control_code == PARTIAL_CLEAR {
unshrink_partial_clear(codetab, queue);
return read_code(is, code_size, codetab, queue);
if let Ok(control_code) = is.read::<u16>(*code_size as u32) {
if control_code == INC_CODE_SIZE && *code_size < MAX_CODE_SIZE {
*code_size += 1;
return read_code(is, code_size, codetab, queue);
}
if control_code == PARTIAL_CLEAR {
unshrink_partial_clear(codetab, queue);
return read_code(is, code_size, codetab, queue);
}
}
return Ok(None);
Ok(None)
}

/// Output the string represented by a code into dst at dst_pos. Returns
Expand Down

0 comments on commit 6bd20b1

Please sign in to comment.