Skip to content

Commit

Permalink
Simplify PlainMem initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpringle committed Aug 18, 2023
1 parent 17acc48 commit b4d487b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions shale/src/cached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ pub struct PlainMem {

impl PlainMem {
pub fn new(size: u64, id: SpaceId) -> Self {
let mut space: Vec<u8> = Vec::new();
space.resize(size as usize, 0);
let space = Arc::new(RwLock::new(space));
// TODO: this could cause problems on a 32-bit system
let space = Arc::new(RwLock::new(vec![0; size as usize]));
Self { space, id }
}
}
Expand Down

0 comments on commit b4d487b

Please sign in to comment.