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

Unified Diff: pkg/analysis_server/lib/src/computer/computer_outline.dart

Issue 629283002: Simplify conversion of empty lists to null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
Index: pkg/analysis_server/lib/src/computer/computer_outline.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_outline.dart b/pkg/analysis_server/lib/src/computer/computer_outline.dart
index 6793753e24444d0bd580fd0358b870078b107bed..da43b614c8cbc4570a279a72660a5796b30e305c 100644
--- a/pkg/analysis_server/lib/src/computer/computer_outline.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_outline.dart
@@ -4,6 +4,7 @@
library computer.outline;
+import 'package:analysis_server/src/collections.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart' as engine;
@@ -178,7 +179,7 @@ class DartUnitOutlineComputer {
element,
sourceRegion.offset,
sourceRegion.length,
- children: classContents.isEmpty ? null : classContents);
+ children: nullIfEmpty(classContents));
scheglov 2014/10/06 17:53:35 Actually, we could probably change the Outline con
}
Outline _newClassTypeAlias(ClassTypeAlias alias) {
@@ -226,7 +227,7 @@ class DartUnitOutlineComputer {
element,
sourceRegion.offset,
sourceRegion.length,
- children: contents.isEmpty ? null : contents);
+ children: nullIfEmpty(contents));
return outline;
}
@@ -262,7 +263,7 @@ class DartUnitOutlineComputer {
element,
sourceRegion.offset,
sourceRegion.length,
- children: contents.isEmpty ? null : contents);
+ children: nullIfEmpty(contents));
return outline;
}
@@ -318,7 +319,7 @@ class DartUnitOutlineComputer {
element,
sourceRegion.offset,
sourceRegion.length,
- children: contents.isEmpty ? null : contents);
+ children: nullIfEmpty(contents));
return outline;
}
@@ -332,7 +333,7 @@ class DartUnitOutlineComputer {
element,
_unit.offset,
_unit.length,
- children: unitContents.isEmpty ? null : unitContents);
+ children: nullIfEmpty(unitContents));
}
Outline _newVariableOutline(String typeName, ElementKind kind,
« no previous file with comments | « pkg/analysis_server/lib/src/collections.dart ('k') | pkg/analysis_server/lib/src/computer/computer_overrides.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698