summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cdeq.h
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-27 15:24:46 +0200
committertylov <[email protected]>2023-07-27 15:24:46 +0200
commita64d171f0eb76c8f208ffc7d8501baa8222634d3 (patch)
treecfb3df4aa28bfeedc4204c3609fa33319a11ad42 /include/stc/cdeq.h
parentc5e7742523c09520f1186458a574ef816f089821 (diff)
downloadSTC-modified-a64d171f0eb76c8f208ffc7d8501baa8222634d3.tar.gz
STC-modified-a64d171f0eb76c8f208ffc7d8501baa8222634d3.zip
An improvement in cvec/cdeq insert_uninit() impl.
Diffstat (limited to 'include/stc/cdeq.h')
-rw-r--r--include/stc/cdeq.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stc/cdeq.h b/include/stc/cdeq.h
index cde2928c..b0575fe0 100644
--- a/include/stc/cdeq.h
+++ b/include/stc/cdeq.h
@@ -156,7 +156,7 @@ _cx_MEMB(_insert_uninit)(_cx_Self* self, const intptr_t idx, const intptr_t n) {
const intptr_t len = _cx_MEMB(_size)(self);
_cx_iter it = {._s=self};
if (len + n > self->capmask)
- if (!_cx_MEMB(_reserve)(self, len + n))
+ if (!_cx_MEMB(_reserve)(self, len*5/4 + n))
return it;
for (intptr_t i = len - 1, j = i + n; i >= idx; --i, --j)
*_cx_MEMB(_at_mut)(self, j) = *_cx_MEMB(_at)(self, i);