3 ms·
Once the i == 4 and i > 4 cases have been eliminated, all code paths in the function return true. It's helpful to remember that the if (table[i] == v) retu
by Arnavion 7y ago
Once the i == 4 and i > 4 cases have been eliminated, all code paths in the function return true. It's helpful to remember that the
if (table[i] == v) return true;
line has an implicit `else continue;` clause, not an `else return false;` clause.
- wtetzner 7y agoOk, so because i never reaches 4, it assumes the loop doesn't exit due to the 'for' condtion, so it must return true. That makes sense, but still feels like a broken way to do optimizations.