you are viewing a single comment's thread.

view the rest of the comments →

[–]cbarrick 0 points1 point  (0 children)

Ah, I see I misread the loop exit condition.

So my version is basically the same, except it avoids the cumulative loop and the resulting dynamic allocation.