Skip to content

Commit 59d728d

Browse files
committed
prefer pre-increment
1 parent adb39e5 commit 59d728d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/minheap.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ auto minheap_add(minheap_t * a_minheap, elem_t * n) -> void
207207
{
208208
/* space for another item at end; swap upwards */
209209

210-
int index = a_minheap->count++;
210+
int index = a_minheap->count;
211+
++a_minheap->count;
211212
int pos = (index - 1) / 2;
212213
while ((index > 0) && (elem_smaller(n, a_minheap->array + pos) != 0))
213214
{

src/search.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,12 @@ auto search_thread_run(int64_t t) -> void
431431
xpthread_mutex_lock(&mutex_output);
432432

433433
/* update stats */
434-
queries++;
434+
++queries;
435435
queries_abundance += qsize;
436436

437437
if (match != 0)
438438
{
439-
qmatches++;
439+
++qmatches;
440440
qmatches_abundance += qsize;
441441
}
442442

0 commit comments

Comments
 (0)