From 892d359ba006708b4ebf585b537df6168fac3d60 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Tue, 25 Feb 2014 19:45:32 -0700 Subject: [PATCH] use size_t for Vector::minimumCapacity --- src/avian/alloc-vector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/avian/alloc-vector.h b/src/avian/alloc-vector.h index cd6f9ff28c..4f7c903740 100644 --- a/src/avian/alloc-vector.h +++ b/src/avian/alloc-vector.h @@ -40,7 +40,7 @@ class Vector { } void dispose() { - if (data.items and minimumCapacity >= 0) { + if (data.items and minimumCapacity > 0) { allocator->free(data.items, data.count); data.items = 0; data.count = 0; @@ -53,13 +53,13 @@ class Vector { this->data = data; this->position = 0; - this->minimumCapacity = -1; + this->minimumCapacity = 0; } void ensure(size_t space) { if (position + space > data.count) { - assert(a, minimumCapacity >= 0); + assert(a, minimumCapacity > 0); size_t newCapacity = avian::util::max( position + space, avian::util::max(minimumCapacity, data.count * 2)); @@ -177,7 +177,7 @@ class Vector { avian::util::Allocator* allocator; avian::util::Slice data; size_t position; - int minimumCapacity; + size_t minimumCapacity; }; } // namespace vm