That's how it used to be.  The code looks more complicated (and has an if inside the for loop) so no real advantage.  In fact, more lines of code.