Skip to content

Commit 0ed25bc

Browse files
kevinbcpovirk
authored andcommitted
isFinite: use && to avoid a ShortCircuitBoolean warning; if there really is benefit to & that could be benchmarked/justified in the future.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=152292580
1 parent 170610e commit 0ed25bc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

guava/src/com/google/common/primitives/Doubles.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static int compare(double a, double b) {
103103
* @since 10.0
104104
*/
105105
public static boolean isFinite(double value) {
106-
return NEGATIVE_INFINITY < value & value < POSITIVE_INFINITY;
106+
return NEGATIVE_INFINITY < value && value < POSITIVE_INFINITY;
107107
}
108108

109109
/**

guava/src/com/google/common/primitives/Floats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static int compare(float a, float b) {
9999
* @since 10.0
100100
*/
101101
public static boolean isFinite(float value) {
102-
return NEGATIVE_INFINITY < value & value < POSITIVE_INFINITY;
102+
return NEGATIVE_INFINITY < value && value < POSITIVE_INFINITY;
103103
}
104104

105105
/**

0 commit comments

Comments
 (0)