diff options
author | Brian Duff <bduff@google.com> | 2015-03-20 11:53:33 -0700 |
---|---|---|
committer | Jeff Davidson <jpd@google.com> | 2015-04-06 15:41:44 -0700 |
commit | 2eadf946678a8a8d3cd56188454ab106b8dc5a39 (patch) | |
tree | c24277c76d73de8c6bcd8b8d8d8d2197dc96ee0c /java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java | |
parent | 001035d84dec844eac16037ac512ad9d35023ac9 (diff) | |
download | external_protobuf-2eadf946678a8a8d3cd56188454ab106b8dc5a39.zip external_protobuf-2eadf946678a8a8d3cd56188454ab106b8dc5a39.tar.gz external_protobuf-2eadf946678a8a8d3cd56188454ab106b8dc5a39.tar.bz2 |
Inline unknownFieldData{Equals,HashCode} to generated code.
It turns out dex (apparently) was inlining these protected final
methods from ExtendableMessageNano into every message class. Removing
these methods from the base class and inlining their code reduces
the method count by 2 methods / message when the store_unknown_fields
option is on.
Change-Id: I0aa09f2016d39939c4c8b8219601793b8fab301f
Diffstat (limited to 'java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java')
-rw-r--r-- | java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java b/java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java index 8244164..4fe8dce 100644 --- a/java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java +++ b/java/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java @@ -160,31 +160,6 @@ public abstract class ExtendableMessageNano<M extends ExtendableMessageNano<M>> return true; } - /** - * Returns whether the stored unknown field data in this message is equivalent to that in the - * other message. - * - * @param other the other message. - * @return whether the two sets of unknown field data are equal. - */ - protected final boolean unknownFieldDataEquals(M other) { - if (unknownFieldData == null || unknownFieldData.isEmpty()) { - return other.unknownFieldData == null || other.unknownFieldData.isEmpty(); - } else { - return unknownFieldData.equals(other.unknownFieldData); - } - } - - /** - * Computes the hashcode representing the unknown field data stored in this message. - * - * @return the hashcode for the unknown field data. - */ - protected final int unknownFieldDataHashCode() { - return (unknownFieldData == null || unknownFieldData.isEmpty() - ? 0 : unknownFieldData.hashCode()); - } - @Override public M clone() throws CloneNotSupportedException { M cloned = (M) super.clone(); |