On 2019-01-02 20:55, Martin Buchholz wrote:
    Which bounds check?


On the second leg, you know you'll never hit the end of the array, so you can elide the check.  But hotspot may not be so clever and may re-insert it, in a slightly more expensive variant that has actual exception throwing code.

I see what you mean now and perhaps that'd eliminate a branch per element if we did toArray inline rather than use an iterator. Might be
a reasonable optimization that can stand on it's own in a follow-up.

/Claes

Reply via email to