Skip to content
Permalink
Browse files
Update the method to make a boolean
There is no requirement to shift the sign bit as the number can be
directly compared to zero.
  • Loading branch information
aherbert committed Aug 13, 2021
1 parent 8246d5a commit 2232aabc3ae634ca9640b709d605a1c95a58d05a
Showing 1 changed file with 2 additions and 2 deletions.
@@ -60,7 +60,7 @@ private NumberFactory() {}
*/
@Deprecated
public static boolean makeBoolean(int v) {
return (v >>> 31) != 0;
return v < 0;
}

/**
@@ -74,7 +74,7 @@ public static boolean makeBoolean(int v) {
*/
@Deprecated
public static boolean makeBoolean(long v) {
return (v >>> 63) != 0;
return v < 0;
}

/**

0 comments on commit 2232aab

Please sign in to comment.