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

Side by Side 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: addressed comments 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 unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.util.relativize; 5 library fasta.util.relativize;
6 6
7 // TODO(ahe): Move more advanced version from dart2js here. 7 // TODO(ahe): Move more advanced version from dart2js here.
8 8
9 String relativizeUri(Uri uri, {Uri base}) { 9 String relativizeUri(Uri uri, {Uri base}) {
10 if (uri == null) return null; 10 if (uri == null) return null;
11 base ??= Uri.base; 11 base ??= Uri.base;
12 String result = "$uri"; 12 String result = "$uri";
13 return result.startsWith("$base") ? result.substring("$base".length) : result; 13 final prefix = "$base";
14 return result.startsWith(prefix) ? result.substring(prefix.length) : result;
14 } 15 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698