From 868a73c707de14ba740d192e67f6f120b2ea0d14 Mon Sep 17 00:00:00 2001 From: ryuukk <44361234+ryuukk@users.noreply.github.com> Date: Thu, 13 Oct 2022 19:41:03 +0200 Subject: [PATCH] Find all types and also their dependencies --- dsymbol/src/dsymbol/symbol.d | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/dsymbol/src/dsymbol/symbol.d b/dsymbol/src/dsymbol/symbol.d index 44263e16..01a04cd9 100644 --- a/dsymbol/src/dsymbol/symbol.d +++ b/dsymbol/src/dsymbol/symbol.d @@ -469,13 +469,29 @@ alias UpdatePairCollection = TTree!(UpdatePair, UpdatePairCollectionAllocator, f void generateUpdatePairs(DSymbol* oldSymbol, DSymbol* newSymbol, ref UpdatePairCollection results) { results.insert(UpdatePair(oldSymbol, newSymbol)); - foreach (part; oldSymbol.parts[]) + foreach (part; oldSymbol.opSlice()) { - auto temp = DSymbol(oldSymbol.name); - auto r = newSymbol.parts.equalRange(SymbolOwnership(&temp)); - if (r.empty) - continue; - generateUpdatePairs(part, r.front, results); + bool has = false; + DSymbol* r = null; + foreach (newPart; newSymbol.opSlice()) + { + if(part == newPart) + { + has = true; + r = newPart; + break; + } + + if (part.name == newPart.name && part.location == newPart.location) + { + has = true; + r = newPart; + break; + } + } + if (!has) continue; + + generateUpdatePairs(part, r, results); } }