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

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

Issue 366463002: Change Maps to HashMaps to save in performance, index and generated directories not touched (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
Index: pkg/analysis_server/lib/src/computer/computer_navigation.dart
diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
index 27aca2b4985d96735d30a74f92175ba1ab1e6d76..76e80a3e09bf32eb44548eca97e4ef07b198d06d 100644
--- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
@@ -4,6 +4,8 @@
library computer.navigation;
+import 'dart:collection';
+
import 'package:analysis_server/src/constants.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
@@ -19,20 +21,20 @@ import 'element.dart' as computer;
class DartUnitNavigationComputer {
final CompilationUnit _unit;
- final List<Map<String, Object>> _regions = <Map<String, Object>>[];
+ final List<HashMap<String, Object>> _regions = <HashMap<String, Object>>[];
DartUnitNavigationComputer(this._unit);
/**
* Returns the computed navigation regions, not `null`.
*/
- List<Map<String, Object>> compute() {
+ List<HashMap<String, Object>> compute() {
_unit.accept(new _DartUnitNavigationComputerVisitor(this));
return new List.from(_regions);
}
void _addRegion(int offset, int length, Element element) {
- Map<String, Object> target = _createTarget(element);
+ HashMap<String, Object> target = _createTarget(element);
if (target == null) {
return;
}
@@ -76,7 +78,7 @@ class DartUnitNavigationComputer {
/**
* Returns the JSON for the given [Element], maybe `null` if `null` was given.
*/
- Map<String, Object> _createTarget(Element element) {
+ HashMap<String, Object> _createTarget(Element element) {
if (element == null) {
return null;
}

Powered by Google App Engine
This is Rietveld 408576698