Can you help me how to avoid the warning in this code ...
Warning: Clang-Tidy: Repeated branch in conditional chain
HubInterface *getFreeHub() {
HubInterface *freeHub = nullptr;
while (freeHub == nullptr) {
for (auto hub : this->getHubList()) {
if (freeHub == nullptr) {
freeHub = hub;
} else if (hub->getStatus() == STATUS_READY &&
hub->getBusyNodes().size() < freeHub->getBusyNodes().size()) {
freeHub = hub;
}
}
sleep(5);
}
return freeHub;
}
Warning provided by CLion IDE