Use enhanced for loop where feasible

See gh-31916
This commit is contained in:
Yanming Zhou
2023-12-28 15:15:07 +08:00
committed by Stéphane Nicoll
parent ed1bfb8177
commit 4a450c6fab
6 changed files with 10 additions and 17 deletions

View File

@@ -20,7 +20,6 @@ import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.concurrent.CompletableFuture;
import org.eclipse.jetty.client.ContentResponse;
@@ -172,9 +171,7 @@ public class JettyXhrTransport extends AbstractXhrTransport implements Lifecycle
private static HttpHeaders toHttpHeaders(HttpFields httpFields) {
HttpHeaders responseHeaders = new HttpHeaders();
Iterator<String> names = httpFields.getFieldNamesCollection().iterator();
while (names.hasNext()) {
String name = names.next();
for (String name : httpFields.getFieldNamesCollection()) {
Enumeration<String> values = httpFields.getValues(name);
while (values.hasMoreElements()) {
String value = values.nextElement();