Skip to content

Commit

Permalink
[JENKINS-37566] - FindBugs: Stop using inefficient iterator logic.
Browse files Browse the repository at this point in the history
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 274d425
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -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();
}
}
}
Expand Down

0 comments on commit 274d425

Please sign in to comment.