chore: ignore loop of asserts on NDEBUG

main
Sean McBride 4 years ago
parent d1d27a9162
commit 392d04423a

@ -133,10 +133,12 @@ perf_window_add(struct perf_window *self, uint64_t value)
/* The idx that we replaces should still point to the same value */ /* The idx that we replaces should still point to the same value */
assert(self->sorted[self->buffer[self->count % PERF_WINDOW_BUFFER_SIZE]].execution_time == value); assert(self->sorted[self->buffer[self->count % PERF_WINDOW_BUFFER_SIZE]].execution_time == value);
/* The sorted array should be ordered by execution time */ /* The sorted array should be ordered by execution time */
#ifndef NDEBUG
for (int i = 1; i < PERF_WINDOW_BUFFER_SIZE; i++) { for (int i = 1; i < PERF_WINDOW_BUFFER_SIZE; i++) {
assert(self->sorted[i - 1].execution_time <= self->sorted[i].execution_time); assert(self->sorted[i - 1].execution_time <= self->sorted[i].execution_time);
} }
#endif
self->count++; self->count++;

Loading…
Cancel
Save