-
Enhancement
-
Resolution: Fixed
-
P5
-
None
-
b12
When initializing j.u.stream.FindOps$FindRef we spin up some duplicate lambda proxy classes:
static final TerminalOp<?, ?> OP_FIND_FIRST = new FindOp<>(true,
StreamShape.REFERENCE, Optional.empty(),
Optional::isPresent, FindSink.OfRef::new);
static final TerminalOp<?, ?> OP_FIND_ANY = new FindOp<>(false,
StreamShape.REFERENCE, Optional.empty(),
Optional::isPresent, FindSink.OfRef::new);
Extracting Optional::isPresent and FindSink.OfRef::new to static constants means we can reuse the lambdas for the different streams. A simple, minor startup win.
static final TerminalOp<?, ?> OP_FIND_FIRST = new FindOp<>(true,
StreamShape.REFERENCE, Optional.empty(),
Optional::isPresent, FindSink.OfRef::new);
static final TerminalOp<?, ?> OP_FIND_ANY = new FindOp<>(false,
StreamShape.REFERENCE, Optional.empty(),
Optional::isPresent, FindSink.OfRef::new);
Extracting Optional::isPresent and FindSink.OfRef::new to static constants means we can reuse the lambdas for the different streams. A simple, minor startup win.
- relates to
-
JDK-8333278 lambda deduplication is not working in some cases
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/47c8a6a8
-
Review(master) openjdk/jdk/19477