diff options
author | Adam Cozzette <acozzette@google.com> | 2016-11-17 16:48:38 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2016-11-17 16:59:59 -0800 |
commit | 5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74 (patch) | |
tree | 0276f81f8848a05d84cd7e287b43d665e30f04e3 /java/util/src/main/java/com/google/protobuf/util/Timestamps.java | |
parent | e28286fa05d8327fd6c5aa70cfb3be558f0932b8 (diff) |
Integrated internal changes from Google
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()); } }; |