Skip to content
Permalink
Browse files

[JENKINS-37566] - FindBugs: Stop using inefficient iterator logic.

I doubt it improves performance much, but makes sense to fix it anyway.
  • Loading branch information...
oleg-nenashev committed Nov 9, 2017
1 parent 49c67ee commit 274d4259ef09329e121afd229d635e4086fa227e
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/org/jenkinsci/remoting/engine/JnlpAgentEndpointResolver.java
@@ -473,9 +473,10 @@ static boolean inNoProxyEnvVar(String host) {
private static List<String> header(@Nonnull HttpURLConnection connection, String... headerNames) {
Map<String, List<String>> headerFields = connection.getHeaderFields();
for (String headerName : headerNames) {
for (String headerField : headerFields.keySet()) {
for (Map.Entry<String, List<String>> entry: headerFields.entrySet()) {
final String headerField = entry.getKey();
if (headerField != null && headerField.equalsIgnoreCase(headerName)) {
return headerFields.get(headerField);
return entry.getValue();
}
}
}

0 comments on commit 274d425

Please sign in to comment.
You can’t perform that action at this time.