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

Unified Diff: pkg/analyzer/lib/src/summary/incremental_cache.dart

Issue 2047573003: Fix for writing structures of imported libraries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/incremental_cache.dart
diff --git a/pkg/analyzer/lib/src/summary/incremental_cache.dart b/pkg/analyzer/lib/src/summary/incremental_cache.dart
index 34cbd85faa721bed423e91525e8d8bcea93d19de..cadeffb6382fec318d809c46d9d16e38aed74822 100644
--- a/pkg/analyzer/lib/src/summary/incremental_cache.dart
+++ b/pkg/analyzer/lib/src/summary/incremental_cache.dart
@@ -140,9 +140,6 @@ class IncrementalCache {
List<Source> closureSources = _getLibraryClosure(librarySource);
List<LibraryBundleWithId> closureBundles = <LibraryBundleWithId>[];
for (Source source in closureSources) {
- if (source.isInSystemLibrary) {
- continue;
- }
if (getSourceKind(source) == SourceKind.PART) {
continue;
}
@@ -250,6 +247,9 @@ class IncrementalCache {
* all its directly or indirectly imported or exported libraries.
*/
void _appendLibraryClosure(Set<Source> closure, Source librarySource) {
+ if (librarySource.isInSystemLibrary) {
+ return;
+ }
if (closure.add(librarySource)) {
CacheSourceContent contentSource = _getCacheSourceContent(librarySource);
if (contentSource == null) {
@@ -457,11 +457,13 @@ class IncrementalCache {
* Write the content based information about the given [source].
*/
void _writeCacheSourceContent(Source source, CacheSourceContentBuilder b) {
- String key = _getCacheSourceContentKey(source);
- List<int> bytes = b.toBuffer();
- storage.put(key, bytes);
- // Put into the cache to avoid reading it later.
- _sourceContentMap[source] = new CacheSourceContent.fromBuffer(bytes);
+ if (!_sourceContentMap.containsKey(source)) {
+ String key = _getCacheSourceContentKey(source);
+ List<int> bytes = b.toBuffer();
+ storage.put(key, bytes);
+ // Put into the cache to avoid reading it later.
+ _sourceContentMap[source] = new CacheSourceContent.fromBuffer(bytes);
+ }
}
/**
@@ -471,10 +473,6 @@ class IncrementalCache {
void _writeCacheSourceContents(LibraryElement library,
[Set<LibraryElement> writtenLibraries]) {
Source librarySource = library.source;
- // Do nothing if already cached.
- if (_sourceContentMap.containsKey(librarySource)) {
- return;
- }
// Stop recursion cycle.
writtenLibraries ??= new Set<LibraryElement>();
if (!writtenLibraries.add(library)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698