Skip to content

Commit

Permalink
Simplify PlainMem initialization (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpringle authored Aug 18, 2023
1 parent bc999b3 commit 1e7ce75
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 1e7ce75

Please sign in to comment.