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

Unified Diff: packages/quiver/lib/pattern.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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
« no previous file with comments | « packages/quiver/lib/mirrors.dart ('k') | packages/quiver/lib/src/async/collect.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/quiver/lib/pattern.dart
diff --git a/packages/quiver/lib/pattern.dart b/packages/quiver/lib/pattern.dart
index 937b0a06a61074799b1b58de0659e16893e8ddcb..31a7cfb98561a3da5fece98648aea76bfe98c33a 100644
--- a/packages/quiver/lib/pattern.dart
+++ b/packages/quiver/lib/pattern.dart
@@ -50,7 +50,7 @@ class _MultiPattern extends Pattern {
{Iterable<Pattern> this.exclude});
Iterable<Match> allMatches(String str, [int start = 0]) {
- var _allMatches = [];
+ final _allMatches = <Match>[];
for (var pattern in include) {
var matches = pattern.allMatches(str, start);
if (_hasMatch(matches)) {
@@ -61,15 +61,15 @@ class _MultiPattern extends Pattern {
}
}
}
- _allMatches.add(matches);
+ _allMatches.addAll(matches);
}
}
- return _allMatches.expand((x) => x);
+ return _allMatches;
}
Match matchAsPrefix(String str, [int start = 0]) {
- return allMatches(str).firstWhere((match) => match.start == start,
- orElse: () => null);
+ return allMatches(str)
+ .firstWhere((match) => match.start == start, orElse: () => null);
}
}
« no previous file with comments | « packages/quiver/lib/mirrors.dart ('k') | packages/quiver/lib/src/async/collect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698