summaryrefslogtreecommitdiffstats
path: root/buf.c
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
commit244c24e0b295023e227f37f62dcab83c28c7614a (patch)
tree228fe3c389cd2178d8929206aedad1d0522d277a /buf.c
parenta21bd3c948730709146a156702c6737568b0fa75 (diff)
downloadtxr-244c24e0b295023e227f37f62dcab83c28c7614a.tar.gz
txr-244c24e0b295023e227f37f62dcab83c28c7614a.tar.bz2
txr-244c24e0b295023e227f37f62dcab83c28c7614a.zip
buf: tiny code improvement.
* buf.c (buf_grow): Use the previously calculated delta value, rather than re-evaluating the equivalent expression.
Diffstat (limited to 'buf.c')
-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;
}