Two small pieces of dead code in mod.ccontrol/ccontrol.cc, both harmless but both misleading to read.
1. A string built on every quit and kill, never read.
In the EVT_QUIT/EVT_KILL case (ccontrol.cc:1065):
string tIP = xIP(tmpUser->getIP()).GetNumericIP(true);
tIP is not read anywhere in that case body. It is scoped to the case, so nothing outside can use it either. The cost is a numeric-IP conversion and a std::string construction for every client leaving the network, network-wide.
2. An else that an earlier return makes unreachable.
In the EVT_GLINE case, the handler returns early when gline saving is off (ccontrol.cc:1204):
if (!saveGlines) {
return;
}
Further down the same case it tests the same flag again and provides an else branch:
if (saveGlines) { ... } else { newGline->setId("-1"); }
Control can only reach that point with saveGlines true, so the else never executes and setId("-1") is dead. Either the early return or the else is redundant; which one depends on what was intended for the saving-disabled case.
Two small pieces of dead code in
mod.ccontrol/ccontrol.cc, both harmless but both misleading to read.1. A string built on every quit and kill, never read.
In the
EVT_QUIT/EVT_KILLcase (ccontrol.cc:1065):tIPis not read anywhere in that case body. It is scoped to the case, so nothing outside can use it either. The cost is a numeric-IP conversion and astd::stringconstruction for every client leaving the network, network-wide.2. An
elsethat an earlierreturnmakes unreachable.In the
EVT_GLINEcase, the handler returns early when gline saving is off (ccontrol.cc:1204):Further down the same case it tests the same flag again and provides an
elsebranch:Control can only reach that point with
saveGlinestrue, so theelsenever executes andsetId("-1")is dead. Either the early return or theelseis redundant; which one depends on what was intended for the saving-disabled case.