add findall/4, bagof/3, setof/3

This commit is contained in:
Mark Thom
2019-02-22 23:22:25 -07:00
parent 0f01d37618
commit 1d331757e2
6 changed files with 216 additions and 24 deletions

View File

@@ -15,16 +15,24 @@ impl Heap {
h: 0 }
}
#[inline]
pub fn push(&mut self, val: HeapCellValue) {
self.heap.push(val);
self.h += 1;
}
#[inline]
pub fn truncate(&mut self, h: usize) {
self.h = h;
self.heap.truncate(h);
}
#[inline]
pub fn last(&self) -> Option<&HeapCellValue> {
self.heap.last()
}
#[inline]
pub fn len(&self) -> usize {
self.heap.len()
}