sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1785050 - /sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
Date Wed, 01 Mar 2017 21:57:50 GMT
Author: desruisseaux
Date: Wed Mar  1 21:57:50 2017
New Revision: 1785050

URL: http://svn.apache.org/viewvc?rev=1785050&view=rev
Log:
Replace ~(rowBit - 1)  by  -rowBit

Modified:
    sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java

Modified: sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java?rev=1785050&r1=1785049&r2=1785050&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/MilitaryGridReferenceSystem.java
[UTF-8] Wed Mar  1 21:57:50 2017
@@ -1083,11 +1083,12 @@ parse:                  switch (part) {
                          *
                          * Note that if there is no zero bit on the left side, then rowBit
= 0.
                          * This implies ~(rowBit - 1) == 0, which is okay for next line of
code.
+                         * Note: ~(rowBit - 1)  ==  -rowBit
                          */
                         rowBit = Integer.lowestOneBit(~(info | (rowBit - 1)));
                     }
-                    if ((info & ~(rowBit - 1)) != 0) {      // Test if there is valid
rows on the left side of sequence of zero bits.
-                        row += GRID_ROW_COUNT;              // Left bits were from previous
cycle, which means that we started a new cycle.
+                    if ((info & -rowBit) != 0) {    // Test if there is valid rows on
the left side of sequence of zero bits.
+                        row += GRID_ROW_COUNT;      // Left bits were from previous cycle,
which means that we started a new cycle.
                     }
                 }
                 row += (info & NORTHING_BITS_MASK) * GRID_ROW_COUNT;        // Add the
pre-computed northing value.



Mime
View raw message