Skip to content

Commit

Permalink
Specify @InlineMe for {Doubles,Floats}#compare
Browse files Browse the repository at this point in the history
This mirrors the changes in 04c1b7a for
similar `#compare` methods.
  • Loading branch information
Stephan202 committed Aug 23, 2024
1 parent 388e098 commit fe0bf2b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions android/guava/src/com/google/common/primitives/Doubles.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Converter;
import com.google.errorprone.annotations.InlineMe;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.Arrays;
Expand Down Expand Up @@ -89,6 +90,7 @@ public static int hashCode(double value) {
* @return a negative value if {@code a} is less than {@code b}; a positive value if {@code a} is
* greater than {@code b}; or zero if they are equal
*/
@InlineMe(replacement = "Double.compare(a, b)")
public static int compare(double a, double b) {
return Double.compare(a, b);
}
Expand Down
2 changes: 2 additions & 0 deletions android/guava/src/com/google/common/primitives/Floats.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Converter;
import com.google.errorprone.annotations.InlineMe;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.Arrays;
Expand Down Expand Up @@ -86,6 +87,7 @@ public static int hashCode(float value) {
* @param b the second {@code float} to compare
* @return the result of invoking {@link Float#compare(float, float)}
*/
@InlineMe(replacement = "Float.compare(a, b)")
public static int compare(float a, float b) {
return Float.compare(a, b);
}
Expand Down
2 changes: 2 additions & 0 deletions guava/src/com/google/common/primitives/Doubles.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Converter;
import com.google.errorprone.annotations.InlineMe;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.Arrays;
Expand Down Expand Up @@ -91,6 +92,7 @@ public static int hashCode(double value) {
* @return a negative value if {@code a} is less than {@code b}; a positive value if {@code a} is
* greater than {@code b}; or zero if they are equal
*/
@InlineMe(replacement = "Double.compare(a, b)")
public static int compare(double a, double b) {
return Double.compare(a, b);
}
Expand Down
2 changes: 2 additions & 0 deletions guava/src/com/google/common/primitives/Floats.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Converter;
import com.google.errorprone.annotations.InlineMe;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.Arrays;
Expand Down Expand Up @@ -86,6 +87,7 @@ public static int hashCode(float value) {
* @param b the second {@code float} to compare
* @return the result of invoking {@link Float#compare(float, float)}
*/
@InlineMe(replacement = "Float.compare(a, b)")
public static int compare(float a, float b) {
return Float.compare(a, b);
}
Expand Down

0 comments on commit fe0bf2b

Please sign in to comment.