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

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

Issue 1910553002: Don't compute hashes in "--build-summary-exclude-informative" mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_elements.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart
index 74e10f018a96b214834ecb576ec3c1d33874a773..de31d5c401655abc11280a21a3edcfa1ba489966 100644
--- a/pkg/analyzer/lib/src/summary/summarize_elements.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart
@@ -137,7 +137,16 @@ class PackageBundleAssembler {
final List<LinkedLibraryBuilder> _linkedLibraries = <LinkedLibraryBuilder>[];
final List<String> _unlinkedUnitUris = <String>[];
final List<UnlinkedUnitBuilder> _unlinkedUnits = <UnlinkedUnitBuilder>[];
- final List<String> _unlinkedUnitHashes = <String>[];
+ final List<String> _unlinkedUnitHashes;
+ final bool _excludeHashes;
+
+ /**
+ * Create a [PackageBundleAssembler]. If [excludeHashes] is `true`, hash
+ * computation will be skipped.
+ */
+ PackageBundleAssembler({bool excludeHashes: false})
+ : _excludeHashes = excludeHashes,
+ _unlinkedUnitHashes = excludeHashes ? null : <String>[];
/**
* Add a fallback library to the package bundle, corresponding to the library
@@ -168,13 +177,15 @@ class PackageBundleAssembler {
}
void addUnlinkedUnit(Source source, UnlinkedUnitBuilder unit) {
- addUnlinkedUnitWithHash(source.uri.toString(), unit, _hash(source.contents.data));
+ addUnlinkedUnitWithHash(source.uri.toString(), unit,
+ _excludeHashes ? null : _hash(source.contents.data));
}
- void addUnlinkedUnitWithHash(String uri, UnlinkedUnitBuilder unit, String hash) {
+ void addUnlinkedUnitWithHash(
+ String uri, UnlinkedUnitBuilder unit, String hash) {
_unlinkedUnitUris.add(uri);
_unlinkedUnits.add(unit);
- _unlinkedUnitHashes.add(hash);
+ _unlinkedUnitHashes?.add(hash);
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698