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

Unified Diff: sdk/lib/_internal/lib/string_helper.dart

Issue 460613002: Add optional start index to Pattern.allMatches. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add extra test. Created 6 years, 4 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: sdk/lib/_internal/lib/string_helper.dart
diff --git a/sdk/lib/_internal/lib/string_helper.dart b/sdk/lib/_internal/lib/string_helper.dart
index e3fb93b40470279eb685584a98d8114f5d36849b..c134844a30c98dff720ac7b0f4920fde9688a661 100644
--- a/sdk/lib/_internal/lib/string_helper.dart
+++ b/sdk/lib/_internal/lib/string_helper.dart
@@ -33,13 +33,13 @@ class StringMatch implements Match {
final String pattern;
}
-List<Match> allMatchesInStringUnchecked(String needle, String haystack) {
+List<Match> allMatchesInStringUnchecked(String needle, String haystack,
+ int startIndex) {
// Copied from StringBase.allMatches in
// /runtime/lib/string_base.dart
List<Match> result = new List<Match>();
int length = haystack.length;
int patternLength = needle.length;
- int startIndex = 0;
while (true) {
int position = haystack.indexOf(needle, startIndex);
if (position == -1) {

Powered by Google App Engine
This is Rietveld 408576698