diff options
| author | Tyge Løvset <[email protected]> | 2020-07-19 23:14:30 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-07-19 23:14:30 +0200 |
| commit | 614287c9e376fea8be395a2c4f8b38ec708444a0 (patch) | |
| tree | 97f8a6494d9d3405a7e18d4a53c95b7e1e83c31f | |
| parent | 741632132ddbd1c5797b85998e08c80208d53f7d (diff) | |
| download | STC-modified-614287c9e376fea8be395a2c4f8b38ec708444a0.tar.gz STC-modified-614287c9e376fea8be395a2c4f8b38ec708444a0.zip | |
Added a minor opt.
| -rw-r--r-- | stc/cvecpq.h | 2 |
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 \
|
