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

Unified Diff: pkg/path/lib/src/context.dart

Issue 309803003: Avoid using RegExps in path to work around issue 19090. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 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
« no previous file with comments | « pkg/path/lib/src/characters.dart ('k') | pkg/path/lib/src/internal_style.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/lib/src/context.dart
diff --git a/pkg/path/lib/src/context.dart b/pkg/path/lib/src/context.dart
index f3826d78c6c307fe23c84184aea9f22e7b7751f2..823e0c28402d83b6b7db1e0f305174be5ac303f7 100644
--- a/pkg/path/lib/src/context.dart
+++ b/pkg/path/lib/src/context.dart
@@ -219,7 +219,7 @@ class Context {
// replaces the path after it.
var parsed = _parse(part);
parsed.root = this.rootPrefix(buffer.toString());
- if (parsed.root.contains(style.needsSeparatorPattern)) {
+ if (style.needsSeparator(parsed.root)) {
parsed.separators[0] = style.separator;
}
buffer.clear();
@@ -230,7 +230,7 @@ class Context {
buffer.clear();
buffer.write(part);
} else {
- if (part.length > 0 && part[0].contains(style.separatorPattern)) {
+ if (part.length > 0 && style.containsSeparator(part[0])) {
// The part starts with a separator, so we don't need to add one.
} else if (needsSeparator) {
buffer.write(separator);
@@ -241,7 +241,7 @@ class Context {
// Unless this part ends with a separator, we'll need to add one before
// the next part.
- needsSeparator = part.contains(style.needsSeparatorPattern);
+ needsSeparator = style.needsSeparator(part);
}
return buffer.toString();
« no previous file with comments | « pkg/path/lib/src/characters.dart ('k') | pkg/path/lib/src/internal_style.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698