Skip to content

Commit

Permalink
Remove unnecessary if statement in ContainerBoxHeader::parse
Browse files Browse the repository at this point in the history
  • Loading branch information
tirr-c committed Sep 19, 2024
1 parent 5fd774a commit d85166c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions jxl/src/container/box_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ impl ContainerBoxHeader {
pub(super) fn parse(reader: &super::ConcatSlice<'_, '_>) -> Result<HeaderParseResult, Error> {
let mut buf = [0u8; 16];
let buf = reader.peek(&mut buf);
if buf.len() < 8 {
return Ok(HeaderParseResult::NeedMoreData);
}

let (tbox, box_size, header_size) = match *buf {
[0, 0, 0, 1, t0, t1, t2, t3, s0, s1, s2, s3, s4, s5, s6, s7, ..] => {
let xlbox = u64::from_be_bytes([s0, s1, s2, s3, s4, s5, s6, s7]);
Expand Down

0 comments on commit d85166c

Please sign in to comment.