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

[tor-commits] [onionoo/master] Avoid inner assignment.



commit b66c87752098a3055a555174bb9cbe30f7ffc759
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Thu Mar 20 10:57:23 2014 +0100

    Avoid inner assignment.
    
    Found with SonarQube.
---
 src/org/torproject/onionoo/ResourceServlet.java |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/org/torproject/onionoo/ResourceServlet.java b/src/org/torproject/onionoo/ResourceServlet.java
index de47d44..27ff414 100644
--- a/src/org/torproject/onionoo/ResourceServlet.java
+++ b/src/org/torproject/onionoo/ResourceServlet.java
@@ -388,7 +388,8 @@ public class ResourceServlet extends HttpServlet {
     int x = 0, y = Integer.MAX_VALUE;
     try {
       if (!parameter.contains("-")) {
-        x = y = Integer.parseInt(parameter);
+        x = Integer.parseInt(parameter);
+        y = x;
       } else {
         String[] parts = parameter.split("-", 2);
         if (parts[0].length() > 0) {



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