aboutsummaryrefslogtreecommitdiffstats
path: root/trace2/tr2_tmr.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2025-05-15 13:11:46 +0000
committerJunio C Hamano <gitster@pobox.com>2025-05-15 13:46:47 -0700
commitfc451e6ea85310725532cbdbc280f8a56a7ec7df (patch)
tree003e2eba20df2e7110dd02083fa6b9b40f4edb7b /trace2/tr2_tmr.c
parentAvoid redundant conditions (diff)
downloadgit-fc451e6ea85310725532cbdbc280f8a56a7ec7df.tar.gz
git-fc451e6ea85310725532cbdbc280f8a56a7ec7df.zip
trace2: avoid "futile conditional"
CodeQL reports empty `if` blocks that only contain a comment as "futile conditional". The comment talks about potential plans to turn this into a warning, but that seems not to have been necessary. Replace the entire construct with a concise comment. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2/tr2_tmr.c')
-rw-r--r--trace2/tr2_tmr.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/trace2/tr2_tmr.c b/trace2/tr2_tmr.c
index 51f564b07a..038181ad9b 100644
--- a/trace2/tr2_tmr.c
+++ b/trace2/tr2_tmr.c
@@ -102,25 +102,11 @@ void tr2_update_final_timers(void)
struct tr2_timer *t_final = &final_timer_block.timer[tid];
struct tr2_timer *t = &ctx->timer_block.timer[tid];
- if (t->recursion_count) {
- /*
- * The current thread is exiting with
- * timer[tid] still running.
- *
- * Technically, this is a bug, but I'm going
- * to ignore it.
- *
- * I don't think it is worth calling die()
- * for. I don't think it is worth killing the
- * process for this bookkeeping error. We
- * might want to call warning(), but I'm going
- * to wait on that.
- *
- * The downside here is that total_ns won't
- * include the current open interval (now -
- * start_ns). I can live with that.
- */
- }
+ /*
+ * `t->recursion_count` could technically be non-zero, which
+ * would constitute a bug. Reporting the bug would potentially
+ * cause an infinite recursion, though, so let's ignore it.
+ */
if (!t->interval_count)
continue; /* this timer was not used by this thread */