/** * Primitive specialised forEach implementation. * <p/> * NB: Renamed from forEach to avoid overloading on parameter types of lambda * expression, which doesn't interplay well with type inference in lambda expressions. * * @param consumer a callback called for each key/value pair in the map. */ public void longForEach(final LongLongConsumer consumer) { final long[] entries = this.entries; for (int i = 0; i < entries.length; i += 2) { final long key = entries[i]; if (key != missingValue) { consumer.accept(entries[i], entries[i + 1]); } } }
/** * Primitive specialised forEach implementation. * <p/> * NB: Renamed from forEach to avoid overloading on parameter types of lambda * expression, which doesn't interplay well with type inference in lambda expressions. * * @param consumer a callback called for each key/value pair in the map. */ public void longForEach(final LongLongConsumer consumer) { final long[] entries = this.entries; for (int i = 0; i < entries.length; i += 2) { final long key = entries[i]; if (key != missingValue) { consumer.accept(entries[i], entries[i + 1]); } } }