From fe0bf2babc14c0e909d67b0e6a085022ac499750 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Fri, 23 Aug 2024 21:05:41 +0200 Subject: [PATCH] Specify `@InlineMe` for `{Doubles,Floats}#compare` This mirrors the changes in 04c1b7a8fd353e4f797aa7002d44174219358979 for similar `#compare` methods. --- android/guava/src/com/google/common/primitives/Doubles.java | 2 ++ android/guava/src/com/google/common/primitives/Floats.java | 2 ++ guava/src/com/google/common/primitives/Doubles.java | 2 ++ guava/src/com/google/common/primitives/Floats.java | 2 ++ 4 files changed, 8 insertions(+) diff --git a/android/guava/src/com/google/common/primitives/Doubles.java b/android/guava/src/com/google/common/primitives/Doubles.java index 7d20829d347b..540f6373492e 100644 --- a/android/guava/src/com/google/common/primitives/Doubles.java +++ b/android/guava/src/com/google/common/primitives/Doubles.java @@ -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; @@ -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); } diff --git a/android/guava/src/com/google/common/primitives/Floats.java b/android/guava/src/com/google/common/primitives/Floats.java index 3e6c86490d10..ff2a25a7207f 100644 --- a/android/guava/src/com/google/common/primitives/Floats.java +++ b/android/guava/src/com/google/common/primitives/Floats.java @@ -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; @@ -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); } diff --git a/guava/src/com/google/common/primitives/Doubles.java b/guava/src/com/google/common/primitives/Doubles.java index 97a6d300ebf9..f0e62035b3f1 100644 --- a/guava/src/com/google/common/primitives/Doubles.java +++ b/guava/src/com/google/common/primitives/Doubles.java @@ -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; @@ -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); } diff --git a/guava/src/com/google/common/primitives/Floats.java b/guava/src/com/google/common/primitives/Floats.java index 3e6c86490d10..ff2a25a7207f 100644 --- a/guava/src/com/google/common/primitives/Floats.java +++ b/guava/src/com/google/common/primitives/Floats.java @@ -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; @@ -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); }