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>
Johannes Schindelin committed
May 15, 2025 at 13:11 UTC
fc451e6ea85310725532cbdbc280f8a56a7ec7df
1 file changed
+5
-19
trace2/tr2_tmr.c
+5
-19
@@ -102,25 +102,11 @@ void tr2_update_final_timers(void)
102
struct tr2_timer *t_final = &final_timer_block.timer[tid];
103
struct tr2_timer *t = &ctx->timer_block.timer[tid];
104
105
- if (t->recursion_count) {
106
- /*
107
- * The current thread is exiting with
108
- * timer[tid] still running.
109
- *
110
- * Technically, this is a bug, but I'm going
111
- * to ignore it.
112
- *
113
- * I don't think it is worth calling die()
114
- * for. I don't think it is worth killing the
115
- * process for this bookkeeping error. We
116
- * might want to call warning(), but I'm going
117
- * to wait on that.
118
- *
119
- * The downside here is that total_ns won't
120
- * include the current open interval (now -
121
- * start_ns). I can live with that.
122
- */
123
- }
105
+ /*
106
+ * `t->recursion_count` could technically be non-zero, which
107
+ * would constitute a bug. Reporting the bug would potentially
108
+ * cause an infinite recursion, though, so let's ignore it.
109
+ */
110
111
if (!t->interval_count)
112
continue; /* this timer was not used by this thread */