From efa8756177cf2da8d58d99ef014913eb79a5616e Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Mon, 11 Dec 2017 09:53:05 -0700 Subject: [PATCH] correct with_capacity function in Heap ADT --- src/prolog/ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prolog/ast.rs b/src/prolog/ast.rs index bb24187e..d8320d5a 100644 --- a/src/prolog/ast.rs +++ b/src/prolog/ast.rs @@ -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) { -- 2.54.0