Skip to content

Commit 122f235

Browse files
committed
simplify with accumulateAndGet
1 parent 9f25d16 commit 122f235

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

dd-java-agent/agent-iast/src/main/java/com/datadog/iast/overhead/OverheadContext.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,8 @@ public void resetMaps() {
105105
AtomicIntegerArray globalCountMap =
106106
globalMap.computeIfAbsent(
107107
endpoint, value -> new AtomicIntegerArray(numberOfVulnerabilities));
108-
int globalCounter = globalCountMap.get(i);
109-
if (counter > globalCounter) {
110-
globalCountMap.set(i, counter);
111-
}
108+
109+
globalCountMap.accumulateAndGet(i, counter, Math::max);
112110
}
113111
}
114112
});

0 commit comments

Comments
 (0)