Skip to content

Commit

Permalink
More inlining :)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Aug 8, 2024
1 parent b0c73bc commit 4a67003
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions breakwater-parser/src/framebuffer/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ impl FrameBuffer for SimpleFrameBuffer {
num_pixels
}

#[inline(always)]
fn as_bytes(&self) -> &[u8] {
let len = 4 * self.buffer.len();
let ptr = self.buffer.as_ptr() as *const u8;
unsafe { std::slice::from_raw_parts(ptr, len) }
}

#[inline(always)]
fn as_pixels(&self) -> &[u32] {
&self.buffer
}
Expand Down

0 comments on commit 4a67003

Please sign in to comment.