We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f7b846 commit 95fc68bCopy full SHA for 95fc68b
operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/EventBuffer.java
@@ -11,11 +11,7 @@ public class EventBuffer {
11
12
public void addEvent(Event event) {
13
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
- }
+ List<Event> crEvents = events.computeIfAbsent(uid, (id) -> new ArrayList<>(1));
19
crEvents.add(event);
20
}
21
0 commit comments