Skip to content

Commit

Permalink
Use spread syntax instead of add (#3296)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough authored Jan 14, 2023
1 parent 820b5ba commit 263ea61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/src/generator/empty_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class EmptyGenerator implements Generator {
@override
Future<void> generate(PackageGraph packageGraph) {
logProgress(packageGraph.defaultPackage.documentationAsHtml);
for (var package in {packageGraph.defaultPackage}
..addAll(packageGraph.localPackages)) {
for (var package in {
packageGraph.defaultPackage,
...packageGraph.localPackages
}) {
for (var category in filterNonDocumented(package.categories)) {
logProgress(category.documentationAsHtml);
}
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package/bin/drill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void main(List<String> argList) {
'INVOCATION_INDEX',
'PACKAGE_INVOCATION_INDEX',
]);
Map<String, String> env = <String, String>{}..addAll(Platform.environment);
Map<String, String> env = <String, String>{...Platform.environment};
env.removeWhere((String key, String value) => !variableNames.contains(key));
env.updateAll(
(key, value) => inputFileRegExp.hasMatch(value) ? '<INPUT_FILE>' : value);
Expand Down
4 changes: 1 addition & 3 deletions tool/subprocess_launcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ class SubprocessLauncher {
Map<String, String>? environment,
bool includeParentEnvironment = true,
void Function(String)? perLine}) async {
environment = {}
..addAll(environmentDefaults)
..addAll(environment ?? {});
environment = {...environmentDefaults, ...?environment};
var jsonObjects = <Map<String, Object?>>[];

/// Allow us to pretend we didn't pass the JSON flag in to dartdoc by
Expand Down

0 comments on commit 263ea61

Please sign in to comment.