[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [exonerator/master] Replace while with for loop.



commit f66289e20c7912c8a8f902f6cf98d328ffe46d06
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Aug 20 15:32:09 2018 +0200

    Replace while with for loop.
---
 .../torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java  | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java b/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java
index d27f8d8..065b986 100644
--- a/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java
+++ b/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java
@@ -32,7 +32,6 @@ import java.sql.Types;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedMap;
@@ -209,10 +208,8 @@ public class ExoneraTorDatabaseImporter {
         DescriptorSourceFactory.createDescriptorReader();
     descriptorReader.setMaxDescriptorsInQueue(20);
     descriptorReader.setExcludedFiles(lastImportHistory);
-    Iterator<Descriptor> descriptors = descriptorReader.readDescriptors(
-        new File(importDirString)).iterator();
-    while (descriptors.hasNext()) {
-      Descriptor descriptor = descriptors.next();
+    for (Descriptor descriptor : descriptorReader.readDescriptors(
+        new File(importDirString))) {
       if (descriptor instanceof RelayNetworkStatusConsensus) {
         parseConsensus((RelayNetworkStatusConsensus) descriptor);
       } else if (descriptor instanceof ExitList) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits