summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-14 21:04:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-14 21:04:11 -0700
commit3a64b6d5805be3abf134bd9552d183d258647b26 (patch)
tree228fe3c389cd2178d8929206aedad1d0522d277a
parent6fdbf16bc477c3021ab3280234e9d584fea8cbd5 (diff)
downloadtxr-3a64b6d5805be3abf134bd9552d183d258647b26.tar.gz
txr-3a64b6d5805be3abf134bd9552d183d258647b26.tar.bz2
txr-3a64b6d5805be3abf134bd9552d183d258647b26.zip
buf: tiny code improvement.
* buf.c (buf_grow): Use the previously calculated delta value, rather than re-evaluating the equivalent expression.
-rw-r--r--buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buf.c b/buf.c
index 145de28f..6ed1e2b9 100644
--- a/buf.c
+++ b/buf.c
@@ -142,7 +142,7 @@ static void buf_grow(struct buf *b, val init_val, val self)
while (size < len) {
cnum delta = size / 4;
if (INT_PTR_MAX - delta >= size)
- size += size / 4;
+ size += delta;
else
size = len;
}