commit fbfd565d48f5a0d990702d8812c43a9310566533
parent 2d70a95e7e135413959d36e7fb5765f195e9efd0
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 9 Mar 2021 20:29:12 -0500
rt::ensure: fix off-by-one
This wasn't breaking anything but there was no need to realloc in this
case
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rt/ensure.ha b/rt/ensure.ha
@@ -6,7 +6,7 @@ export type slice = struct {
export fn ensure(s: *slice, membsz: size) void = {
let cap = s.capacity;
- if (cap > s.length) {
+ if (cap >= s.length) {
return;
};
for (cap < s.length) {