[tor-commits] [exonerator/release] Replace while with for loop.
karsten at torproject.org
karsten at torproject.org
Tue Aug 28 10:23:59 UTC 2018
commit f66289e20c7912c8a8f902f6cf98d328ffe46d06
Author: Karsten Loesing <karsten.loesing at gmx.net>
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) {
More information about the tor-commits
mailing list