title: c++ Warning: Clang-Tidy: Repeated branch in conditional chain
body: <p>Can you help me how to avoid the warning in this code ...</p>
  
  <blockquote>
    <p>Warning: Clang-Tidy: Repeated branch in conditional chain</p>
  </blockquote>
  
  <pre class="lang-cpp prettyprint-override"><code>HubInterface *getFreeHub() {
          HubInterface *freeHub = nullptr;
          while (freeHub == nullptr) {
              for (auto hub : this-&gt;getHubList()) {
                  if (freeHub == nullptr) {
                      freeHub = hub;
                  } else if (hub-&gt;getStatus() == STATUS_READY &amp;&amp;
                             hub-&gt;getBusyNodes().size() &lt; freeHub-&gt;getBusyNodes().size()) {
                      freeHub = hub;
                  }
              }
              sleep(5);
          }
          return freeHub;
      }
  </code></pre>
  
  <p><em>Warning provided by CLion IDE</em></p>