]> Repositorios git - scryer-prolog.git/commitdiff
correct with_capacity function in Heap ADT
authorMark Thom <[email protected]>
Mon, 11 Dec 2017 16:53:05 +0000 (09:53 -0700)
committerMark Thom <[email protected]>
Mon, 11 Dec 2017 16:53:05 +0000 (09:53 -0700)
src/prolog/ast.rs

index bb24187e678e452fac3b0e1b883eb655ddbff631..d8320d5abaf38e14f3ef3b528d76ffcfcac6054a 100644 (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) {