-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Open
Labels
Description
This is the code:
if (!(b->flags & MY_FLAG)) {
if ((mstime - b->time_change) >= GET_MIN(b)) {
b->flags |= MY_FLAG;
lw->evt_fn(lw, b, OPR);
b->ka.last_time = mstime;
}
} else {
if ((mstime - b->ka.last_time) >= PERIOD(b)) {
b->ka.last_time += PERIOD(b);
++b->ka.cnt;
lw->evt_fn(lw, b, OPS);
}
}
For which clang-tidy 15.0.0-rc3
throws an error: warning: if with identical then and else branches [bugprone-branch-clone]
Command is called as: clang-tidy -checks='*' file.c
How can this be same if and else branch?