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

Unified Diff: lib/src/protobuf/utils.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
Index: lib/src/protobuf/utils.dart
diff --git a/lib/src/protobuf/utils.dart b/lib/src/protobuf/utils.dart
index 6e6482bcdc104e90d5c02aa800f48271b10f0b24..a9993e3dd7cde7045fbc2700aab4169f3043d25b 100644
--- a/lib/src/protobuf/utils.dart
+++ b/lib/src/protobuf/utils.dart
@@ -18,10 +18,11 @@ bool _deepEquals(lhs, rhs) {
}
bool _areListsEqual(List lhs, List rhs) {
- range(i) => new Iterable.generate(i, (i) => i);
-
if (lhs.length != rhs.length) return false;
- return range(lhs.length).every((i) => _deepEquals(lhs[i], rhs[i]));
+ for (var i = 0; i < lhs.length; i++) {
+ if (!_deepEquals(lhs[i], rhs[i])) return false;
+ }
+ return true;
}
bool _areMapsEqual(Map lhs, Map rhs) {
« CHANGELOG.md ('K') | « lib/src/protobuf/generated_message.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698