Skip to content

Commit

Permalink
Use temporary list for intermediate result
Browse files Browse the repository at this point in the history
  • Loading branch information
ties committed Aug 29, 2023
1 parent aaef5f2 commit 61b464c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/ripe/rpki/rsyncit/rrdp/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public State() {
public void removeOldObject(Instant cutOffTime) {
var expired = times.entrySet().stream().filter(entry ->
entry.getValue().getLastMentioned().isBefore(cutOffTime)
);
).toList();

var removedCount = expired.filter(entry -> times.remove(entry.getKey(), entry.getValue())).count();
var removedCount = expired.stream().filter(entry -> times.remove(entry.getKey(), entry.getValue())).count();
if (log.isInfoEnabled()) {
log.debug("Cleaned {} items from timestamp cache", removedCount);
}
Expand Down

0 comments on commit 61b464c

Please sign in to comment.