diff options
Diffstat (limited to 'java/util/src/main/java/com/google/protobuf/util/Timestamps.java')
-rw-r--r-- | java/util/src/main/java/com/google/protobuf/util/Timestamps.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/java/util/src/main/java/com/google/protobuf/util/Timestamps.java b/java/util/src/main/java/com/google/protobuf/util/Timestamps.java index 52b1ab98..2160e4d5 100644 --- a/java/util/src/main/java/com/google/protobuf/util/Timestamps.java +++ b/java/util/src/main/java/com/google/protobuf/util/Timestamps.java @@ -37,7 +37,6 @@ import static com.google.common.math.LongMath.checkedAdd; import static com.google.common.math.LongMath.checkedMultiply; import static com.google.common.math.LongMath.checkedSubtract; -import com.google.common.collect.ComparisonChain; import com.google.protobuf.Duration; import com.google.protobuf.Timestamp; import java.text.ParseException; @@ -101,11 +100,8 @@ public final class Timestamps { public int compare(Timestamp t1, Timestamp t2) { checkValid(t1); checkValid(t2); - - return ComparisonChain.start() - .compare(t1.getSeconds(), t2.getSeconds()) - .compare(t1.getNanos(), t2.getNanos()) - .result(); + int secDiff = Long.compare(t1.getSeconds(), t2.getSeconds()); + return (secDiff != 0) ? secDiff : Integer.compare(t1.getNanos(), t2.getNanos()); } }; |