public void intForEach(final IntIntConsumer consumer)
    {
        final int[] entries = this.entries;
        final int missingValue = this.missingValue;
        @DoNotSub final int length = entries.length;

        for (@DoNotSub int keyIndex = 0; keyIndex < length; keyIndex += 2)
        {
            if (entries[keyIndex + 1] != missingValue) // lgtm [java/index-out-of-bounds]
            {
                consumer.accept(entries[keyIndex], entries[keyIndex + 1]); // lgtm [java/index-out-of-bounds]
            }
        }
    }
public void intForEach ( final IntIntConsumer consumer ) { final int [ ] entries = this . entries ; final int missingValue = this . missingValue ; @ DoNotSub final int length = entries . length ; for ( @ DoNotSub int keyIndex = 0 ; keyIndex < length ; keyIndex += 2 ) { if ( entries [ keyIndex + 1 ] != missingValue ) { consumer . accept ( entries [ keyIndex ] , entries [ keyIndex + 1 ] ) ; } } }
Primitive specialised forEach implementation.
<p>
NB: Renamed from forEach to avoid overloading on parameter types of lambda
expression, which doesn't play well with type inference in lambda expressions.

@param consumer a callback called for each key/value pair in the map.