Cornedbee, thank you for a more concise version of the function. If I understand correctly, the do...while loop is more efficient than a while loop? Is this because the do..while executes the loop once and then checks to go on, instead of checking every-time before executing, as the while loop does?
It might be more efficient in this particular case, but what's important is that the code has lower complexity. It's easier to read (if you know how do...while works, at least). Efficiency on this low level is irrelevant; the compiler will know what to do.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law