From 392d04423a3720c844e3b1acff1dce3e401c79bf Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Mon, 10 Aug 2020 22:53:04 -0400 Subject: [PATCH] chore: ignore loop of asserts on NDEBUG --- runtime/include/perf_window.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/include/perf_window.h b/runtime/include/perf_window.h index fca06bd..e7ca112 100644 --- a/runtime/include/perf_window.h +++ b/runtime/include/perf_window.h @@ -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 */ 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++) { assert(self->sorted[i - 1].execution_time <= self->sorted[i].execution_time); } +#endif self->count++;