3 ms·
But the simplest thing to do would be return after logging 0 rather than loop thousands of times for no reason. By that I mean, the second example in my eyes is
by dangerface 6y ago
But the simplest thing to do would be return after logging 0 rather than loop thousands of times for no reason. By that I mean, the second example in my eyes is simpler.
The simplest code as you point out is often faster than the shortest.