From: Mark Thom Date: Mon, 11 Dec 2017 16:53:05 +0000 (-0700) Subject: correct with_capacity function in Heap ADT X-Git-Tag: v0.8.110~650 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=efa8756177cf2da8d58d99ef014913eb79a5616e;p=scryer-prolog.git correct with_capacity function in Heap ADT --- 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) {