* tools/virsh.c (vshCommandRun): Test only the initial value of
ctl->timing, so that static analyzers don't have to consider that
it might be changed by cmd->def->handler.
while (cmd) {
struct timeval before, after;
+ bool enable_timing = ctl->timing;
if ((ctl->conn == NULL) || (disconnected != 0))
vshReconnect(ctl);
- if (ctl->timing)
+ if (enable_timing)
GETTIMEOFDAY(&before);
ret = cmd->def->handler(ctl, cmd);
- if (ctl->timing)
+ if (enable_timing)
GETTIMEOFDAY(&after);
if (ret == FALSE)
if (STREQ(cmd->def->name, "quit")) /* hack ... */
return ret;
- if (ctl->timing)
+ if (enable_timing)
vshPrint(ctl, _("\n(Time: %.3f ms)\n\n"),
DIFF_MSEC(&after, &before));
else