commit 40fa74b6253fdab46810b1f6335f2e6f776f0083
parent e96125bad6a424ba587dc18ba97fbefbf2c62e5d
Author: William Casarin <jb55@jb55.com>
Date: Thu, 10 Aug 2023 12:26:31 -0700
build: fix compilation of ndb_process_events in release mode
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/nostrdb.c b/nostrdb.c
@@ -625,7 +625,9 @@ int ndb_process_events(struct ndb *ndb, const char *ldjson, int json_len)
start = ldjson;
end = start + json_len;
very_end = ldjson + json_len;
+#if DEBUG
int processed = 0;
+#endif
while ((end = fast_strchr(start, '\n', very_end - start))) {
//printf("processing '%.*s'\n", (int)(end-start), start);
@@ -634,7 +636,9 @@ int ndb_process_events(struct ndb *ndb, const char *ldjson, int json_len)
return 0;
}
start = end + 1;
+#if DEBUG
processed++;
+#endif
}
ndb_debug("ndb_process_events: processed %d events\n", processed);