From 4add6c3211afce8cf01e9bd68d30a9a4991e29f8 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Mon, 24 Feb 2025 07:20:44 +1100 Subject: [PATCH] [Cleanup] Follow-up on #566 - fix style (#568) --- src/LGraphNode.ts | 4 +++- src/utils/collections.ts | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index 2b181cf653..8515b9891d 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -2409,7 +2409,9 @@ export class LGraphNode implements Positionable, IPinnable, IColorable { target_node.inputs[targetIndex].link = link_info.id // Reroutes - for (const x of LLink.getReroutes(graph, link_info)) x?.linkIds.add(nextId) + for (const reroute of LLink.getReroutes(graph, link_info)) { + reroute?.linkIds.add(nextId) + } graph._version++ // link_info has been created now, so its updated diff --git a/src/utils/collections.ts b/src/utils/collections.ts index c2c20ad55f..e433b60b91 100644 --- a/src/utils/collections.ts +++ b/src/utils/collections.ts @@ -10,13 +10,17 @@ import { LGraphNode } from "@/LGraphNode" */ export function getAllNestedItems(items: ReadonlySet): Set { const allItems = new Set() - if (items) for (const x of items) addRecursively(x, allItems) + if (items) { + for (const item of items) addRecursively(item, allItems) + } return allItems function addRecursively(item: Positionable, flatSet: Set): void { if (flatSet.has(item) || item.pinned) return flatSet.add(item) - if (item.children) for (const x of item.children) addRecursively(x, flatSet) + if (item.children) { + for (const child of item.children) addRecursively(child, flatSet) + } } }