mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
rename local functions with _
s
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions. Change-Id: I8a558d2c9b80d2a0411ca8603201d62451c734dd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242501 Reviewed-by: Srujan Gaddam <srujzs@google.com> Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
parent
cdaf885546
commit
4b7a27a922
|
@ -303,15 +303,15 @@ void compareGraphs(AllInfo info) {
|
|||
// differently than 'deps' links
|
||||
int inUsesNotInDependencies = 0;
|
||||
int inDependenciesNotInUses = 0;
|
||||
_sameEdges(f) {
|
||||
sameEdges(f) {
|
||||
var targets1 = g1.targetsOf(f).toSet();
|
||||
var targets2 = g2.targetsOf(f).toSet();
|
||||
inUsesNotInDependencies += targets1.difference(targets2).length;
|
||||
inDependenciesNotInUses += targets2.difference(targets1).length;
|
||||
}
|
||||
|
||||
info.functions.forEach(_sameEdges);
|
||||
info.fields.forEach(_sameEdges);
|
||||
info.functions.forEach(sameEdges);
|
||||
info.fields.forEach(sameEdges);
|
||||
if (inUsesNotInDependencies == 0 && inDependenciesNotInUses == 0) {
|
||||
_pass('dependency data is consistent');
|
||||
} else {
|
||||
|
|
|
@ -56,7 +56,7 @@ void printSizes(Map<String, int> sizeByImport, int programSize) {
|
|||
int longest = importSizes.fold('Percent of code deferred'.length,
|
||||
(longest, importSize) => max(longest, importSize.import.length));
|
||||
|
||||
_printRow(label, data, {int width = 15}) {
|
||||
printRow(label, data, {int width = 15}) {
|
||||
print('${label.toString().padRight(longest + 1)}'
|
||||
'${data.toString().padLeft(width)}');
|
||||
}
|
||||
|
@ -66,16 +66,16 @@ void printSizes(Map<String, int> sizeByImport, int programSize) {
|
|||
print('-' * (longest + 16));
|
||||
for (var importSize in importSizes) {
|
||||
// TODO(het): split into specific and shared size
|
||||
_printRow(importSize.import, importSize.size);
|
||||
printRow(importSize.import, importSize.size);
|
||||
}
|
||||
print('-' * (longest + 16));
|
||||
|
||||
var mainChunkSize = sizeByImport['main'];
|
||||
var deferredSize = programSize - mainChunkSize;
|
||||
var percentDeferred = (deferredSize * 100 / programSize).toStringAsFixed(2);
|
||||
_printRow('Main chunk size', mainChunkSize);
|
||||
_printRow('Deferred code size', deferredSize);
|
||||
_printRow('Percent of code deferred', '$percentDeferred%');
|
||||
printRow('Main chunk size', mainChunkSize);
|
||||
printRow('Deferred code size', deferredSize);
|
||||
printRow('Percent of code deferred', '$percentDeferred%');
|
||||
}
|
||||
|
||||
Map<String, int> getSizeByImport(AllInfo info) {
|
||||
|
|
|
@ -131,12 +131,12 @@ class LibrarySizeCommand extends Command<void> with PrintUsageException {
|
|||
var realTotal = info.program.size;
|
||||
var longest = 0;
|
||||
var rows = <_Row>[];
|
||||
_addRow(String label, int value) {
|
||||
addRow(String label, int value) {
|
||||
rows.add(_Row(label, value));
|
||||
longest = max(longest, label.length);
|
||||
}
|
||||
|
||||
_printRow(_Row row) {
|
||||
printRow(_Row row) {
|
||||
if (row is _Divider) {
|
||||
print(' ${'-' * (longest + 18)}');
|
||||
return;
|
||||
|
@ -157,14 +157,14 @@ class LibrarySizeCommand extends Command<void> with PrintUsageException {
|
|||
lastCluster = entry.cluster;
|
||||
}
|
||||
var size = entry.size;
|
||||
_addRow(name, size);
|
||||
addRow(name, size);
|
||||
}
|
||||
rows.add(const _Divider());
|
||||
_addRow("All libraries (excludes preambles, statics & consts)", allLibs);
|
||||
_addRow("Shared consts", allConstants);
|
||||
_addRow("Total accounted", allLibs + allConstants);
|
||||
_addRow("Program Size", realTotal);
|
||||
rows.forEach(_printRow);
|
||||
addRow("All libraries (excludes preambles, statics & consts)", allLibs);
|
||||
addRow("Shared consts", allConstants);
|
||||
addRow("Total accounted", allLibs + allConstants);
|
||||
addRow("Program Size", realTotal);
|
||||
rows.forEach(printRow);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue