[tor-commits] [exonerator/release] use faster lastIndexOf(char) instead of lastIndexOf(String)

karsten at torproject.org karsten at torproject.org
Mon Apr 13 10:02:18 UTC 2020


commit 639b9ebd2f545c3bd42fb756b76bd3c4328c462a
Author: tordinge <tordinge at aprivatesub.net>
Date:   Mon Feb 24 20:47:11 2020 -0500

    use faster lastIndexOf(char) instead of lastIndexOf(String)
---
 .../org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java b/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java
index 1e5f3bb..3dbb119 100644
--- a/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java
+++ b/src/main/java/org/torproject/metrics/exonerator/ExoneraTorDatabaseImporter.java
@@ -244,7 +244,7 @@ public class ExoneraTorDatabaseImporter {
         orAddresses.add(entry.getAddress());
         for (String orAddressAndPort : entry.getOrAddresses()) {
           orAddresses.add(orAddressAndPort.substring(0,
-              orAddressAndPort.lastIndexOf(":")));
+              orAddressAndPort.lastIndexOf(':')));
         }
         importStatusentry(validAfter, fingerprintBase64, nickname,
             exit, orAddresses);





More information about the tor-commits mailing list