[ACS-9736] Cleanup

This commit is contained in:
Kacper Magdziarz
2025-07-18 14:51:46 +02:00
parent 0114731890
commit 685842fe00

View File

@@ -632,16 +632,11 @@ public class AuditComponentImpl implements AuditComponent
{ {
String path = entry.getKey(); String path = entry.getKey();
String rootKey = AuditApplication.getRootKey(path); String rootKey = AuditApplication.getRootKey(path);
Map<String, Serializable> rootKeyMappedValues = mappedValuesByRootKey.get(rootKey); Map<String, Serializable> rootKeyMappedValues = mappedValuesByRootKey.computeIfAbsent(rootKey, k -> new HashMap<>(7));
if (rootKeyMappedValues == null)
{
rootKeyMappedValues = new HashMap<>(7);
mappedValuesByRootKey.put(rootKey, rootKeyMappedValues);
}
rootKeyMappedValues.put(path, entry.getValue()); rootKeyMappedValues.put(path, entry.getValue());
} }
Map<String, Serializable> allAuditedValues = new HashMap<String, Serializable>(mappedValues.size() * 2 + 1); Map<String, Serializable> allAuditedValues = new HashMap<>(mappedValues.size() * 2 + 1);
// Now audit for each of the root keys // Now audit for each of the root keys
for (Map.Entry<String, Map<String, Serializable>> entry : mappedValuesByRootKey.entrySet()) for (Map.Entry<String, Map<String, Serializable>> entry : mappedValuesByRootKey.entrySet())
{ {