Skip to content

Commit 95fc68b

Browse files
csviriSoroosh Sarabadani
andauthored
Update operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/EventBuffer.java
Co-authored-by: Soroosh Sarabadani <[email protected]>
1 parent 0f7b846 commit 95fc68b

File tree

1 file changed

+1
-5
lines changed
  • operator-framework/src/main/java/io/javaoperatorsdk/operator/processing

1 file changed

+1
-5
lines changed

operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/EventBuffer.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ public class EventBuffer {
1111

1212
public void addEvent(Event event) {
1313
String uid = event.getRelatedCustomResourceUid();
14-
List<Event> crEvents = events.get(uid);
15-
if (crEvents == null) {
16-
crEvents = new ArrayList<>(1);
17-
events.put(uid, crEvents);
18-
}
14+
List<Event> crEvents = events.computeIfAbsent(uid, (id) -> new ArrayList<>(1));
1915
crEvents.add(event);
2016
}
2117

0 commit comments

Comments
 (0)