Skip to content

Commit

Permalink
Switched from Map to Set in code flow routine (minor cleanup).
Browse files Browse the repository at this point in the history
  • Loading branch information
msfterictraut committed Sep 15, 2021
1 parent a53e8af commit f39520a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/pyright-internal/src/analyzer/typeEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18229,7 +18229,7 @@ export function createTypeEvaluator(
// is specified, it returns true only if at least one control flow
// path passes through sourceFlowNode.
function isFlowNodeReachable(flowNode: FlowNode, sourceFlowNode?: FlowNode): boolean {
const visitedFlowNodeMap = new Map<number, true>();
const visitedFlowNodeMap = new Set<number>();

function isFlowNodeReachableRecursive(flowNode: FlowNode, sourceFlowNode: FlowNode | undefined): boolean {
let curFlowNode = flowNode;
Expand All @@ -18242,7 +18242,7 @@ export function createTypeEvaluator(
}

// Note that we've been here before.
visitedFlowNodeMap.set(curFlowNode.id, true);
visitedFlowNodeMap.add(curFlowNode.id);

if (curFlowNode.flags & FlowFlags.Unreachable) {
return false;
Expand Down

0 comments on commit f39520a

Please sign in to comment.