Skip to content

Commit 63a1210

Browse files
committed
Inline list creator
1 parent 48bfe24 commit 63a1210

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎scijava/scijava-ops-engine/src/main/java/org/scijava/ops/engine/DefaultOpEnvironment.java‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -754,13 +754,6 @@ private synchronized void initIdDirectory() {
754754
.forEach(info -> idDirectory.put(info.id(), info));
755755
}
756756

757-
/**
758-
* Function for populating opDirectory with new ArrayList.
759-
* Declared only once, right here
760-
*/
761-
private final Function<String, List<OpInfo>> nameListCreator = //
762-
(name) -> new ArrayList<>();
763-
764757
private final BiConsumer<OpInfo, Logger> addToOpIndex = (final OpInfo opInfo, final Logger log) -> {
765758
if (opInfo.names() == null || opInfo.names().size() == 0) {
766759
log.error("Skipping Op " + opInfo.implementationName() + ":\n" +
@@ -773,7 +766,7 @@ private synchronized void initIdDirectory() {
773766
return;
774767
}
775768
for (String opName : opInfo.names()) {
776-
opDirectory.computeIfAbsent(opName, nameListCreator).add(opInfo);
769+
opDirectory.computeIfAbsent(opName, name -> new ArrayList<>()).add(opInfo);
777770
}
778771
};
779772

0 commit comments

Comments
 (0)