Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: lib/src/protobuf/generated_message.dart

Issue 2012073002: Reduce the number of dynamic calls. (Closed) Base URL: git@github.com:dart-lang/dart-protobuf.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« CHANGELOG.md ('K') | « CHANGELOG.md ('k') | lib/src/protobuf/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/protobuf/generated_message.dart
diff --git a/lib/src/protobuf/generated_message.dart b/lib/src/protobuf/generated_message.dart
index 8e076128a05836ec73b3822a264a0fd64e34503f..ef513c0076590a013cec813a7b29b37a1d1978df 100644
--- a/lib/src/protobuf/generated_message.dart
+++ b/lib/src/protobuf/generated_message.dart
@@ -67,10 +67,8 @@ abstract class GeneratedMessage {
// TODO(antonm): move to getters.
int getTagNumber(String fieldName) => info_.tagNumber(fieldName);
- bool operator ==(other) {
- if (other is! GeneratedMessage) return false;
- return _fieldSet._equals(other._fieldSet);
- }
+ bool operator ==(other) =>
+ other is GeneratedMessage ? _fieldSet._equals(other._fieldSet) : false;
/// Calculates a hash code based on the contents of the protobuf.
///
« CHANGELOG.md ('K') | « CHANGELOG.md ('k') | lib/src/protobuf/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698