Skip to content

Commit 4d9cadc

Browse files
committed
Use Function.identity() instead
1 parent 3d28f9b commit 4d9cadc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/src/main/java/org/elasticsearch/ingest/IngestStats.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.util.List;
3232
import java.util.Map;
3333
import java.util.concurrent.TimeUnit;
34+
import java.util.function.Function;
3435

3536
public record IngestStats(Stats totalStats, List<PipelineStat> pipelineStats, Map<String, List<ProcessorStat>> processorStats)
3637
implements
@@ -82,8 +83,8 @@ public static IngestStats read(StreamInput in) throws IOException {
8283
var processorType = in.readString();
8384
var processorStat = readStats(in);
8485
// pass these name and type through the local names and types cache to canonical-ize them
85-
processorName = namesAndTypesCache.computeIfAbsent(processorName, k -> k);
86-
processorType = namesAndTypesCache.computeIfAbsent(processorType, k -> k);
86+
processorName = namesAndTypesCache.computeIfAbsent(processorName, Function.identity());
87+
processorType = namesAndTypesCache.computeIfAbsent(processorType, Function.identity());
8788
processorStatsPerPipeline.add(new ProcessorStat(processorName, processorType, processorStat));
8889
}
8990
processorStats.put(pipelineId, Collections.unmodifiableList(processorStatsPerPipeline));

0 commit comments

Comments
 (0)