(&mut self)
| 103 | impl<'a> Decoder<'a, f32> for F32Decoder<'a> { |
| 104 | #[inline(always)] |
| 105 | fn decode(&mut self) -> f32 { |
| 106 | let mantissa_ptr = unsafe { self.mantissa.next_unchecked_as_ptr() }; |
| 107 | |
| 108 | // Loading 4 bytes instead of 3 is 30% faster, so we read 1 extra byte after mantissa_ptr. |
| 109 | // Safety: The extra byte is within bounds because sign_exp comes after mantissa. |
| 110 | let mantissa_extended = unsafe { *(mantissa_ptr as *const [u8; 4]) }; |
| 111 | let mantissa = u32::from_le_bytes(mantissa_extended) & 0xFF_FF_FF; |
| 112 | |
| 113 | let sign_exp = unsafe { self.sign_exp.next_unchecked() }; |
| 114 | f32::from_bits(mantissa | ((sign_exp as u32) << 24)) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | #[cfg(test)] |
nothing calls this directly
no test coverage detected