From a0699ed922829723431e76064fd5ed33c165fe5d Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Fri, 18 May 2018 10:31:57 +0200 Subject: [PATCH] Added comment --- src/siri/db/series.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/siri/db/series.c b/src/siri/db/series.c index 71388d12..8f54c615 100644 --- a/src/siri/db/series.c +++ b/src/siri/db/series.c @@ -884,8 +884,13 @@ siridb_points_t * siridb_series_get_last( (*required_shard)++; + +#if DEBUG /* if not in the buffer, then if must be in a shard */ assert (series->idx_len); +#endif + + /* if not in the buffer, then if must be in a shard */ size_t i = series->idx_len - 1; idx_t * idx = series->idx + i; @@ -912,7 +917,11 @@ siridb_points_t * siridb_series_get_last( NULL, series->flags & SIRIDB_SERIES_HAS_OVERLAP); +#if DEBUG + /* we must have at least one point, more points are possible when + * having multiple points at the same time-stamp. */ assert (points->len); +#endif while (points->len > 1) { -- 2.39.5