use a boxed array insted of a vec

This commit is contained in:
Noa Aarts 2025-09-25 14:38:21 +02:00
parent a8b40e6101
commit c547773570
Signed by: noa
GPG key ID: 1850932741EFF672

View file

@ -18,7 +18,7 @@ pub trait Grid<I, V> {
pub struct Flut<T> {
size_x: usize,
size_y: usize,
cells: SyncUnsafeCell<Vec<T>>,
cells: SyncUnsafeCell<Box<[T]>>,
last_hash: SyncUnsafeCell<u64>,
jpgbuf: RwLock<Vec<u8>>,
}
@ -32,7 +32,7 @@ impl<T: Clone> Flut<T> {
Flut {
size_x,
size_y,
cells: vec.into(),
cells: vec.into_boxed_slice().into(),
last_hash: 0.into(),
jpgbuf: RwLock::new(Vec::new()),
}