<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r69383407">src/mlpack/methods/ne/genome.hpp</a>:</p>
<pre style='color:#555'>&gt; +
&gt; +  // Get link index by innovation id.
&gt; +  ssize_t GetLinkIndex(ssize_t innovId) const {
&gt; +    for(ssize_t i=0; i &lt; NumLink(); ++i) {
&gt; +        if (aLinkGenes[i].InnovationId() == innovId) {
&gt; +            return i;
&gt; +        }
&gt; +    }
&gt; +
&gt; +    return -1;  // Id start from 0.
&gt; +  }
&gt; +
&gt; +  // Whether link exist and enabled.
&gt; +  bool ContainEnabledLink(ssize_t innovId) const {
&gt; +    for(ssize_t i=0; i &lt; NumLink(); ++i) {
&gt; +        if (aLinkGenes[i].InnovationId() == innovId &amp;&amp;
</pre>
<p>If we split the if condition, we could return right after we found the neuron with the specified <code>innovId</code>, enabled or not.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/686/files/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383407">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFOha44QWqajLdYwTVxy8iaXIRtb5ks5qRuXggaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFENzOF8OYfGKsd6-96-KWjd92finks5qRuXggaJpZM4IwJa6.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/686/files/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383407"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>