Skip to content

Commit

Permalink
Add a 'clear' method to map.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewycky committed Nov 25, 2019
1 parent 5c1c786 commit 94eca51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/runtime-core/src/structures/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ where
}
}

/// Clears the map. Keeps the allocated memory for future use.
pub fn clear(&mut self) {
self.elems.clear();
}

/// Returns the size of this map.
pub fn len(&self) -> usize {
self.elems.len()
Expand Down

0 comments on commit 94eca51

Please sign in to comment.