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

Unified Diff: pkg/front_end/lib/src/fasta/util/relativize.dart

Issue 2708893002: fasta: Cache relativizeUri(fileUri) on LibraryBuilder and ClassBuilder (or rather it's base class) (Closed)
Patch Set: Reorder import Created 3 years, 10 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/front_end/lib/src/fasta/util/relativize.dart
diff --git a/pkg/front_end/lib/src/fasta/util/relativize.dart b/pkg/front_end/lib/src/fasta/util/relativize.dart
index 59e9f16b290ed986f35b02698718b58fc6f26862..bae65ede779f3c82e00161bee48f8858885124e0 100644
--- a/pkg/front_end/lib/src/fasta/util/relativize.dart
+++ b/pkg/front_end/lib/src/fasta/util/relativize.dart
@@ -9,6 +9,7 @@ library fasta.util.relativize;
String relativizeUri(Uri uri, {Uri base}) {
if (uri == null) return null;
base ??= Uri.base;
- String result = "$uri";
ahe 2017/02/21 14:15:23 I prefer the existing style, and I know dart2js ge
- return result.startsWith("$base") ? result.substring("$base".length) : result;
+ String result = uri.toString();
+ final prefix = base.toString();
ahe 2017/02/21 14:15:22 String prefix = "$base";
kustermann 2017/02/22 14:40:28 I changed it because I saw some interpolate instru
ahe 2017/02/22 14:50:06 Let's not forget this. I'm pretty sure we have a b
+ return result.startsWith(prefix) ? result.substring(prefix.length) : result;
}

Powered by Google App Engine
This is Rietveld 408576698