Re: Implementations of PrimitiveIterator.OfInt#forEachRemaining(IntConsumer) doesn't check IntConsumer for null

2018-06-06 Thread Paul Sandoz
Performance should not be a concern, null checking is highly optimized by the JIT and is anyway required when the consumer is accessed in the loop. It’s probably an oversight but FWIW these internal iterators are never exposed directly and are wrapped in spliterators and those wrappers will

Implementations of PrimitiveIterator.OfInt#forEachRemaining(IntConsumer) doesn't check IntConsumer for null

2018-06-05 Thread Андрей Турбанов
Hello. I observe that implementations of `forEachRemaining` method inside java.lang.CharSequence doesn't always compare IntConsumer parameter with null. Is there any reason why there is no nonNull check? Performance? Andrey Turbanov.