mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-05 08:08:11 -07:00
Use Vec::with_capacity (#891)
Co-authored-by: Matthew Martin <phy1729@Matthews-Mac-mini.local>
This commit is contained in:
@@ -50,7 +50,7 @@ impl GenericFramebuffer for Framebuffer {
|
||||
rop: 0,
|
||||
};
|
||||
|
||||
let mut raw_buffer = Vec::new();
|
||||
let mut raw_buffer = Vec::with_capacity(buffer.len() * 2);
|
||||
for (r, g, b) in buffer {
|
||||
let mut rgb565: u16 = (r as u16 & 0b11111000) << 8;
|
||||
rgb565 |= (g as u16 & 0b11111100) << 3;
|
||||
|
||||
Reference in New Issue
Block a user