From 59c7d96ea73d20c0d9e3f6552a8736777c6c68aa Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Sat, 8 Apr 2017 01:07:39 -0700 Subject: [PATCH] Migrate QueryableVarDef to indicies --- src/query.cc | 15 +++++---------- src/query.h | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/query.cc b/src/query.cc index 1917dced..c2d2a793 100644 --- a/src/query.cc +++ b/src/query.cc @@ -103,16 +103,11 @@ QueryableVarDef::DefUpdate MapIdToUsr(const IdMap& id_map, const IndexedVarDef:: QueryableVarDef::DefUpdate result(def.usr); result.short_name = def.short_name; result.qualified_name = def.qualified_name; - if (def.declaration) - result.declaration = MapIdToUsr(id_map, def.declaration.value()); - if (def.definition_spelling) - result.definition_spelling = MapIdToUsr(id_map, def.definition_spelling.value()); - if (def.definition_extent) - result.definition_extent = MapIdToUsr(id_map, def.definition_extent.value()); - if (def.variable_type) - result.variable_type = MapIdToUsr(id_map, def.variable_type.value()); - if (def.declaring_type) - result.declaring_type = MapIdToUsr(id_map, def.declaring_type.value()); + result.declaration = id_map.ToQuery(def.declaration); + result.definition_spelling = id_map.ToQuery(def.definition_spelling); + result.definition_extent = id_map.ToQuery(def.definition_extent); + result.variable_type = id_map.ToQuery(def.variable_type); + result.declaring_type = id_map.ToQuery(def.declaring_type); return result; } diff --git a/src/query.h b/src/query.h index 86b82f96..ead9945d 100644 --- a/src/query.h +++ b/src/query.h @@ -209,7 +209,7 @@ struct QueryableFuncDef { }; struct QueryableVarDef { - using DefUpdate = VarDefDefinitionData; + using DefUpdate = VarDefDefinitionData; using UsesUpdate = MergeableUpdate; DefUpdate def;