BUG-2825: remove unused calculation 87/35387/4
authorRobert Varga <robert.varga@pantheon.sk>
Thu, 25 Feb 2016 10:43:18 +0000 (11:43 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 25 Feb 2016 15:23:30 +0000 (15:23 +0000)
Funky way of writing a constant, let's fold it. Make it clearer what we
are doing and also helps the compiler.

Change-Id: I64e6667347568e0e472b053508c545e5b79fff3a
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
model/ietf/ietf-type-util/src/main/java/org/opendaylight/mdsal/model/ietf/util/Ipv6Utils.java

index 6672600dc1f5448c02f79158606b482b737956c9..d50a07ef30cf6c09ebd171aa11727c01b44adce6 100644 (file)
@@ -130,8 +130,8 @@ final class Ipv6Utils {
 
            final int n = j - colonp;
            for (i = 1; i <= n; i++) {
-               dst[INADDR6SZ - i] = dst[colonp + n - i];
-               dst[colonp + n - i] = 0;
+               dst[INADDR6SZ - i] = dst[j - i];
+               dst[j - i] = 0;
            }
        } else {
            Verify.verify(j == INADDR6SZ, "Overrun in parsing of '%s', should not occur", addrStr);