Commit 1189ccc9 authored by dreis2211's avatar dreis2211 Committed by Stephane Nicoll

Use Collection.removeIf() where possible

See gh-13871
parent 1ec16923
...@@ -18,7 +18,6 @@ package org.springframework.boot.actuate.trace.http; ...@@ -18,7 +18,6 @@ package org.springframework.boot.actuate.trace.http;
import java.net.URI; import java.net.URI;
import java.security.Principal; import java.security.Principal;
import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -103,12 +102,7 @@ public class HttpExchangeTracer { ...@@ -103,12 +102,7 @@ public class HttpExchangeTracer {
return new LinkedHashMap<>(); return new LinkedHashMap<>();
} }
Map<String, List<String>> headers = headersSupplier.get(); Map<String, List<String>> headers = headersSupplier.get();
Iterator<String> keys = headers.keySet().iterator(); headers.keySet().removeIf(s -> !headerPredicate.test(s));
while (keys.hasNext()) {
if (!headerPredicate.test(keys.next())) {
keys.remove();
}
}
return headers; return headers;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment