Skip to content

Commit b2b8c86

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 95fc68b commit b2b8c86

File tree

1 file changed

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

1 file changed

+1
-6
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ public boolean containsEvents(String customResourceId) {
2121

2222
public List<Event> getAndRemoveEventsForExecution(String resourceUid) {
2323
List<Event> crEvents = events.remove(resourceUid);
24-
if (crEvents == null) {
25-
crEvents = Collections.emptyList();
26-
}
27-
List<Event> result = new ArrayList<>(crEvents);
28-
crEvents.clear();
29-
return result;
24+
return crEvents == null ? Collections.emptyList() : crEvents;
3025
}
3126

3227
public void cleanup(String resourceUid) {

0 commit comments

Comments
 (0)