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

Unified Diff: packages/matcher/lib/src/string_matchers.dart

Issue 3015713002: Roll to pickup pool changes
Patch Set: Created 3 years, 3 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/matcher/lib/src/numeric_matchers.dart ('k') | packages/matcher/lib/src/util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/matcher/lib/src/string_matchers.dart
diff --git a/packages/matcher/lib/src/string_matchers.dart b/packages/matcher/lib/src/string_matchers.dart
index d8bbdb83ec5961c3ad0462428b3acaa3a3fc6ab8..14e6fbb61692b66307faf76a26c91757dbc6014e 100644
--- a/packages/matcher/lib/src/string_matchers.dart
+++ b/packages/matcher/lib/src/string_matchers.dart
@@ -118,15 +118,16 @@ class _StringContainsInOrder extends _StringMatcher {
const _StringContainsInOrder(this._substrings);
bool matches(item, Map matchState) {
- if (!(item is String)) {
+ if (item is String) {
+ var from_index = 0;
+ for (var s in _substrings) {
+ from_index = item.indexOf(s, from_index);
+ if (from_index < 0) return false;
+ }
+ return true;
+ } else {
return false;
}
- var from_index = 0;
- for (var s in _substrings) {
- from_index = item.indexOf(s, from_index);
- if (from_index < 0) return false;
- }
- return true;
}
Description describe(Description description) => description.addAll(
« no previous file with comments | « packages/matcher/lib/src/numeric_matchers.dart ('k') | packages/matcher/lib/src/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698