refactor(domain): reuse ordered map appends in index builders (#14548)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-11-25 15:19:22 +00:00
1 parent 15e5b421bf
commit 5cd8658643
49 files changed
+115 -195

No files matched your search

@@ -1,3 +1,4 @@
import { appendToMapList } from "../../domain/appendToMapList.js";
import type { AnalysisParameterLimit } from "../../domain/analysisSettings.js";
import {
createJavaScriptSemanticGraph,
@@ -1072,10 +1073,7 @@ const projectCalls = (context: FileContext): void => {
JavaScriptSemanticCallReturnFlow[]
>();
for (const flow of context.ir.callReturnFlows) {
const grouped = returnFlowsByCallSite.get(flow.callSiteId);
if (grouped === undefined)
returnFlowsByCallSite.set(flow.callSiteId, [flow]);
else grouped.push(flow);
appendToMapList(returnFlowsByCallSite, flow.callSiteId, flow);
addRelation(context.state, {
source: context.returnSiteNodes.get(flow.returnSiteId),
target: context.callSiteNodes.get(flow.callSiteId),