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

[tor-commits] [metrics-lib/release] Inline redundant local variables.



commit 4a1c02c61a9853fc93a087f51cbf020fe315447c
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Aug 21 14:10:29 2018 +0200

    Inline redundant local variables.
---
 src/main/java/org/torproject/descriptor/impl/ParseHelper.java    | 4 +---
 .../descriptor/impl/RelayNetworkStatusConsensusImplTest.java     | 9 +++------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/torproject/descriptor/impl/ParseHelper.java b/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
index 514bea8..dcb365e 100644
--- a/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
+++ b/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
@@ -477,9 +477,7 @@ public class ParseHelper {
               masterKeyEd25519, 0, masterKeyEd25519.length);
           String masterKeyEd25519Base64
               = Base64.encodeBase64String(masterKeyEd25519).replaceAll("=", "");
-          String masterKeyEd25519Base64NoTrailingEqualSigns =
-              masterKeyEd25519Base64.replaceAll("=", "");
-          return masterKeyEd25519Base64NoTrailingEqualSigns;
+          return masterKeyEd25519Base64.replaceAll("=", "");
         }
         extensionStart += 4 + extensionLength;
       }
diff --git a/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java b/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java
index 53d79c7..b4c7d8a 100644
--- a/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java
+++ b/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java
@@ -141,9 +141,8 @@ public class RelayNetworkStatusConsensusImplTest {
         sb.append(this.voteDigestLine).append("\n");
       }
       String dirSourceWithTrailingNewLine = sb.toString();
-      String dirSource = dirSourceWithTrailingNewLine.substring(0,
+      return dirSourceWithTrailingNewLine.substring(0,
           dirSourceWithTrailingNewLine.length() - 1);
-      return dirSource;
     }
   }
 
@@ -299,9 +298,8 @@ public class RelayNetworkStatusConsensusImplTest {
         sb.append(this.pLine).append("\n");
       }
       String statusEntryWithTrailingNewLine = sb.toString();
-      String statusEntry = statusEntryWithTrailingNewLine.substring(0,
+      return statusEntryWithTrailingNewLine.substring(0,
           statusEntryWithTrailingNewLine.length() - 1);
-      return statusEntry;
     }
   }
 
@@ -339,7 +337,7 @@ public class RelayNetworkStatusConsensusImplTest {
     }
 
     private String buildDirectorySignature() {
-      String directorySignature = "directory-signature " + identity + " "
+      return "directory-signature " + identity + " "
           + signingKey + "\n"
           + "-----BEGIN SIGNATURE-----\n"
           + "gE64+/4BH43v1+7jS9FK1tu2+94at8xhVSPn4O/PpOx7b0Yb+S1hac1QHAiS"
@@ -348,7 +346,6 @@ public class RelayNetworkStatusConsensusImplTest {
                 + "P3JG\n"
           + "z89A+wrsN17I5490y66AEvws54BYZMbgRfp8HXn/0Ss=\n"
           + "-----END SIGNATURE-----";
-      return directorySignature;
     }
   }
 



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