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

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

Issue 429173002: Don't cache path Context based on cwd, as cwd involves a system-call to compute. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup. Created 6 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
Index: pkg/path/lib/path.dart
diff --git a/pkg/path/lib/path.dart b/pkg/path/lib/path.dart
index 599a351507326afcb6a34b2cfc2bdae5061d3c27..a537b058b651b457b09701b52de9d090fe2422e4 100644
--- a/pkg/path/lib/path.dart
+++ b/pkg/path/lib/path.dart
@@ -62,22 +62,9 @@ final windows = new Context(style: Style.windows);
/// A default context for manipulating URLs.
final url = new Context(style: Style.url);
-/// The result of [Uri.base] last time the current working directory was
-/// calculated.
-///
-/// This is used to invalidate [_cachedContext] when the working directory has
-/// changed since the last time a function was called.
-Uri _lastBaseUri;
-
/// An internal context for the current OS so we can provide a straight
/// functional interface and not require users to create one.
-Context get _context {
- if (_cachedContext != null && Uri.base == _lastBaseUri) return _cachedContext;
- _lastBaseUri = Uri.base;
- _cachedContext = new Context();
- return _cachedContext;
-}
-Context _cachedContext;
+final Context _context = new Context.internal();
/// Returns the [Style] of the current context.
///

Powered by Google App Engine
This is Rietveld 408576698