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

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

Issue 951463005: Small improvements for indexing NameElements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/index/index.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/index/store/codec.dart
diff --git a/pkg/analysis_server/lib/src/services/index/store/codec.dart b/pkg/analysis_server/lib/src/services/index/store/codec.dart
index d340abc6592c60857666eb1664cbef3f657f5583..c6cf992389a07884e4e2ce0100bd822bef45981e 100644
--- a/pkg/analysis_server/lib/src/services/index/store/codec.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/codec.dart
@@ -104,8 +104,13 @@ class ElementCodec {
* file paths instead of [Element] location URIs.
*/
int encode(Element element, bool forKey) {
- ElementLocationImpl location = element.location;
+ if (element is NameElement) {
+ String name = element.name;
+ int nameId = _stringCodec.encode(name);
+ return _encodePath(<int>[nameId]);
+ }
// check the location has a cached id
+ ElementLocationImpl location = element.location;
if (!identical(location.indexOwner, this)) {
location.indexKeyId = null;
location.indexLocationId = null;
« no previous file with comments | « pkg/analysis_server/lib/src/services/index/index.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698