correct with_capacity function in Heap ADT

This commit is contained in:
Mark Thom
2017-12-11 09:53:05 -07:00
parent 829b8278da
commit efa8756177

View File

@@ -964,7 +964,7 @@ pub struct Heap {
impl Heap {
pub fn with_capacity(cap: usize) -> Self {
Heap { heap: vec![HeapCellValue::Str(0); cap], h: 0 }
Heap { heap: Vec::with_capacity(cap), h: 0 }
}
pub fn push(&mut self, val: HeapCellValue) {