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

Unified Diff: pkg/analyzer/lib/src/index/store/codec.dart

Issue 365193004: Move Index and IndexStore implementations into Engine. (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/analyzer/lib/src/index/store/codec.dart
diff --git a/pkg/analysis_server/lib/src/index/store/codec.dart b/pkg/analyzer/lib/src/index/store/codec.dart
similarity index 92%
rename from pkg/analysis_server/lib/src/index/store/codec.dart
rename to pkg/analyzer/lib/src/index/store/codec.dart
index 20a66fd560190c5588665a6f31363360e6278e78..770dada470271f65c5c0cd27b448f1c65c3bcc17 100644
--- a/pkg/analysis_server/lib/src/index/store/codec.dart
+++ b/pkg/analyzer/lib/src/index/store/codec.dart
@@ -2,14 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library index.store.codec;
+library engine.src.index.store.codec;
import 'dart:collection';
-import 'package:analysis_server/src/index/store/collection.dart';
+import 'package:analyzer/index/index.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/index.dart';
+import 'package:analyzer/src/index/store/collection.dart';
/**
@@ -67,17 +67,17 @@ class ContextCodec {
* A helper that encodes/decodes [Element]s to/from integers.
*/
class ElementCodec {
+ final StringCodec _stringCodec;
+
/**
- * A list that works as a mapping of integers to element encodings (in form of integer arrays).
+ * A table mapping element encodings to a single integer.
*/
- List<List<int>> _indexToPath = [];
+ final IntArrayToIntMap _pathToIndex = new IntArrayToIntMap();
/**
- * A table mapping element locations (in form of integer arrays) into a single integer.
+ * A list that works as a mapping of integers to element encodings.
*/
- IntArrayToIntMap _pathToIndex = new IntArrayToIntMap();
-
- final StringCodec _stringCodec;
+ final List<List<int>> _indexToPath = <List<int>>[];
ElementCodec(this._stringCodec);
@@ -189,12 +189,12 @@ class StringCodec {
/**
* A table mapping names to their unique indices.
*/
- final Map<String, int> nameToIndex = {};
+ final Map<String, int> nameToIndex = new HashMap<String, int>();
/**
* A table mapping indices to the corresponding strings.
*/
- List<String> _indexToName = [];
+ final List<String> _indexToName = <String>[];
/**
* Returns the [String] that corresponds to the given index.

Powered by Google App Engine
This is Rietveld 408576698