Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/lib/litegraph/src/subgraph/SubgraphOutput.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pull } from 'lodash'

import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
import { LLink } from '@/lib/litegraph/src/LLink'
import type { RerouteId } from '@/lib/litegraph/src/Reroute'
Expand All @@ -9,7 +11,6 @@ import type {
} from '@/lib/litegraph/src/interfaces'
import { LiteGraph } from '@/lib/litegraph/src/litegraph'
import { NodeSlotType } from '@/lib/litegraph/src/types/globalEnums'
import { removeFromArray } from '@/lib/litegraph/src/utils/collections'

import type { SubgraphInput } from './SubgraphInput'
import type { SubgraphOutputNode } from './SubgraphOutputNode'
Expand Down Expand Up @@ -59,7 +60,7 @@ export class SubgraphOutput extends SubgraphSlot {
existingLink.disconnect(subgraph, 'input')
const resolved = existingLink.resolve(subgraph)
const links = resolved.output?.links
if (links) removeFromArray(links, existingLink.id)
if (links) pull(links, existingLink.id)
}

const link = new LLink(
Expand Down
8 changes: 0 additions & 8 deletions src/lib/litegraph/src/utils/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,3 @@ export function findFreeSlotOfType<T extends { type: ISlotType }>(
}
return wildSlot ?? occupiedSlot ?? occupiedWildSlot
}

export function removeFromArray<T>(array: T[], value: T): boolean {
const index = array.indexOf(value)
const found = index !== -1

if (found) array.splice(index, 1)
return found
}
Loading