Skip to content

Commit

Permalink
switched yieldItems List->Set for quicker "includes" (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson4j authored Dec 3, 2024
1 parent 13c81dc commit 532ff90
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ export function completionCoreCompletion(
);
if (callContext instanceof CallClauseContext) {
const procedureNameCtx = callContext.procedureName();
const existingYieldItems = callContext
.procedureResultItem_list()
.map((a) => a.getText());
const existingYieldItems = new Set(
callContext.procedureResultItem_list().map((a) => a.getText()),
);
const name = getMethodName(procedureNameCtx);
return procedureReturnCompletions(name, dbSchema).filter(
(a) => !existingYieldItems.includes(a?.label),
(a) => !existingYieldItems.has(a?.label),
);
}
}
Expand Down

0 comments on commit 532ff90

Please sign in to comment.