[Cleanup] Remove unused code (#913)

This commit is contained in:
filtered
2025-04-09 19:35:08 +10:00
committed by GitHub
parent ae4a63c839
commit c60e9d8080

View File

@@ -258,7 +258,11 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
?.findNextReroute(withParentId, visited)
}
findSourceOutput(): { node: LGraphNode, output: INodeOutputSlot, outputIndex: number, link: LLink } | undefined {
/**
* Finds the output node and output slot of the first link passing through this reroute.
* @returns The output node and output slot of the first link passing through this reroute, or `undefined` if no link is found.
*/
findSourceOutput(): { node: LGraphNode, output: INodeOutputSlot } | undefined {
const link = this.firstLink ?? this.firstFloatingLink
if (!link) return
@@ -268,22 +272,20 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
return {
node,
output: node.outputs[link.origin_slot],
outputIndex: link.origin_slot,
link,
}
}
/**
* Finds the inputs and nodes for links or floating links passing through this reroute.
* Finds the inputs and nodes of (floating) links passing through this reroute.
* @returns An array of objects containing the node and input slot of each link passing through this reroute.
*/
findTargetInputs(): { node: LGraphNode, input: INodeInputSlot, inputIndex: number, link: LLink }[] | undefined {
findTargetInputs(): { node: LGraphNode, input: INodeInputSlot, link: LLink }[] | undefined {
const network = this.#network.deref()
if (!network) return
const results: {
node: LGraphNode
input: INodeInputSlot
inputIndex: number
link: LLink
}[] = []
@@ -305,7 +307,7 @@ export class Reroute implements Positionable, LinkSegment, Serialisable<Serialis
const input = node?.inputs[link.target_slot]
if (!input) continue
results.push({ node, input, inputIndex: link.target_slot, link })
results.push({ node, input, link })
}
}
}