summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-07-19 23:14:30 +0200
committerTyge Løvset <[email protected]>2020-07-19 23:14:30 +0200
commit614287c9e376fea8be395a2c4f8b38ec708444a0 (patch)
tree97f8a6494d9d3405a7e18d4a53c95b7e1e83c31f
parent741632132ddbd1c5797b85998e08c80208d53f7d (diff)
downloadSTC-modified-614287c9e376fea8be395a2c4f8b38ec708444a0.tar.gz
STC-modified-614287c9e376fea8be395a2c4f8b38ec708444a0.zip
Added a minor opt.
-rw-r--r--stc/cvecpq.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/stc/cvecpq.h b/stc/cvecpq.h
index a6134620..441859a5 100644
--- a/stc/cvecpq.h
+++ b/stc/cvecpq.h
@@ -96,7 +96,7 @@ cvec_##tag##_pushPriorityQ(CVec_##tag* self, CVecValue_##tag value) { \
CVecValue_##tag *arr = self->data - 1; \
for (; c > 1 && cvec_##tag##_sortCompare(&arr[c >> 1], &value) cmpOpr 0; c >>= 1) \
arr[c] = arr[c >> 1]; \
- arr[c] = value; \
+ if (c != n) arr[c] = value; \
} \
\
STC_API void \