Skip to content

Commit

Permalink
Change to getAndSet
Browse files Browse the repository at this point in the history
  • Loading branch information
akang31 committed Jan 19, 2024
1 parent ed35d1f commit 8f8bad6
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ private List<PropertyUsageEvent> createEventList(PropertyUsageEvent event) {
}

private Map<String, PropertyUsageData> getAndClearUsageMap() {
Map<String, PropertyUsageData> map =
propertyUsageMapRef.getAndUpdate(unused -> new ConcurrentHashMap<>());
Map<String, PropertyUsageData> map = propertyUsageMapRef.getAndSet(new ConcurrentHashMap<>());
return Collections.unmodifiableMap(new HashMap<>(map));
}

Expand Down

0 comments on commit 8f8bad6

Please sign in to comment.