Skip to content

Commit 0c603e1

Browse files
committed
Don't use Source to compute absolute URI in _getLibraryByRelativeUri().
It does not matter usually, unless we live in the environment where actual Source resolution is very expensive. This makes resynthsis about 10% faster in this case. [email protected] BUG= Review URL: https://codereview.chromium.org/2386363002 .
1 parent 154bd38 commit 0c603e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/analyzer/lib/src/summary/resynthesize.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ import 'package:analyzer/src/generated/resolver.dart';
1919
import 'package:analyzer/src/generated/source_io.dart';
2020
import 'package:analyzer/src/generated/testing/ast_factory.dart';
2121
import 'package:analyzer/src/generated/testing/token_factory.dart';
22+
import 'package:analyzer/src/generated/utilities_dart.dart';
2223
import 'package:analyzer/src/summary/format.dart';
2324
import 'package:analyzer/src/summary/idl.dart';
25+
import 'package:analyzer/src/util/fast_uri.dart';
2426

2527
/**
2628
* Implementation of [ElementResynthesizer] used when resynthesizing an element
@@ -1160,9 +1162,8 @@ class _LibraryResynthesizerContext implements LibraryResynthesizerContext {
11601162
}
11611163

11621164
LibraryElementHandle _getLibraryByRelativeUri(String depUri) {
1163-
String absoluteUri = resynthesizer.summaryResynthesizer.sourceFactory
1164-
.resolveUri(resynthesizer.librarySource, depUri)
1165-
.uri
1165+
String absoluteUri = resolveRelativeUri(
1166+
resynthesizer.librarySource.uri, FastUri.parse(depUri))
11661167
.toString();
11671168
return new LibraryElementHandle(resynthesizer.summaryResynthesizer,
11681169
new ElementLocationImpl.con3(<String>[absoluteUri]));

0 commit comments

Comments
 (0)