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

[tor-commits] [collector/master] Avoid unnecessary continue statements.



commit 6714bde1ced764d70b0ad1f3b85bd7f7319d25fb
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Aug 21 15:19:29 2018 +0200

    Avoid unnecessary continue statements.
---
 .../metrics/collector/bridgedescs/BridgeSnapshotReader.java   | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/torproject/metrics/collector/bridgedescs/BridgeSnapshotReader.java b/src/main/java/org/torproject/metrics/collector/bridgedescs/BridgeSnapshotReader.java
index f16122a..68ee28b 100644
--- a/src/main/java/org/torproject/metrics/collector/bridgedescs/BridgeSnapshotReader.java
+++ b/src/main/java/org/torproject/metrics/collector/bridgedescs/BridgeSnapshotReader.java
@@ -143,13 +143,9 @@ public class BridgeSnapshotReader {
                 BufferedReader br3 = new BufferedReader(new StringReader(
                     ascii));
                 String firstLine;
-                while ((firstLine = br3.readLine()) != null) {
-                  if (firstLine.startsWith("@")) {
-                    continue;
-                  } else {
-                    break;
-                  }
-                }
+                do {
+                  firstLine = br3.readLine();
+                } while (firstLine != null && firstLine.startsWith("@"));
                 if (firstLine == null) {
                   continue;
                 }
@@ -224,7 +220,6 @@ public class BridgeSnapshotReader {
           } catch (IOException e) {
             logger.warn("Could not parse bridge snapshot {}!", pop.getName(),
                 e);
-            continue;
           }
         }
       }

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