Skip to content

Commit

Permalink
Address feedback; replace use of byte_range with slice since we d…
Browse files Browse the repository at this point in the history
…on't need the ImmutableBuffer
  • Loading branch information
nirosys committed May 10, 2024
1 parent ef49f33 commit 91b37d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lazy/binary/raw/v1_1/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ impl<'top> LazyRawBinaryValue_1_1<'top> {
let value = match self.encoded_value.value_body_length {
8 => {
let mut buffer = [0; 8];
let val_bytes = self.input.slice(1, 8);
buffer[..8].copy_from_slice(val_bytes.bytes());
let val_bytes = self.input.bytes_range(1, 8);
buffer[..8].copy_from_slice(val_bytes);

f64::from_le_bytes(buffer)
}
4 => {
let mut buffer = [0; 4];
let val_bytes = self.input.slice(1, 4);
buffer[..4].copy_from_slice(val_bytes.bytes());
let val_bytes = self.input.bytes_range(1, 4);
buffer[..4].copy_from_slice(val_bytes);

f32::from_le_bytes(buffer).into()
}
Expand Down

0 comments on commit 91b37d7

Please sign in to comment.