Skip to content

Commit 4c9f987

Browse files
Sync changes from internal repo. (#98)
1 parent 31e583d commit 4c9f987

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/src/protobuf/generated_message.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ abstract class GeneratedMessage {
6767
// TODO(antonm): move to getters.
6868
int getTagNumber(String fieldName) => info_.tagNumber(fieldName);
6969

70-
bool operator ==(other) =>
71-
other is GeneratedMessage ? _fieldSet._equals(other._fieldSet) : false;
70+
bool operator ==(other) {
71+
if (identical(this, other)) return true;
72+
return other is GeneratedMessage
73+
? _fieldSet._equals(other._fieldSet)
74+
: false;
75+
}
7276

7377
/// Calculates a hash code based on the contents of the protobuf.
7478
///

0 commit comments

Comments
 (0)