MCPcopy Create free account
hub / github.com/Nynxz/ComfyUI-IdeogramHelper / patchKeyedChildren

Function patchKeyedChildren

web/main.js:5446–5604  ·  view source on GitHub ↗
(c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized)

Source from the content-addressed store, hash-verified

5444 }
5445 };
5446 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
5447 let i = 0;
5448 const l2 = c2.length;
5449 let e1 = c1.length - 1;
5450 let e2 = l2 - 1;
5451 while (i <= e1 && i <= e2) {
5452 const n1 = c1[i];
5453 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
5454 if (isSameVNodeType(n1, n2)) {
5455 patch(
5456 n1,
5457 n2,
5458 container,
5459 null,
5460 parentComponent,
5461 parentSuspense,
5462 namespace,
5463 slotScopeIds,
5464 optimized
5465 );
5466 } else {
5467 break;
5468 }
5469 i++;
5470 }
5471 while (i <= e1 && i <= e2) {
5472 const n1 = c1[e1];
5473 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
5474 if (isSameVNodeType(n1, n2)) {
5475 patch(
5476 n1,
5477 n2,
5478 container,
5479 null,
5480 parentComponent,
5481 parentSuspense,
5482 namespace,
5483 slotScopeIds,
5484 optimized
5485 );
5486 } else {
5487 break;
5488 }
5489 e1--;
5490 e2--;
5491 }
5492 if (i > e1) {
5493 if (i <= e2) {
5494 const nextPos = e2 + 1;
5495 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
5496 while (i <= e2) {
5497 patch(
5498 null,
5499 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
5500 container,
5501 anchor,
5502 parentComponent,
5503 parentSuspense,

Callers 1

patchChildrenFunction · 0.85

Calls 10

cloneIfMountedFunction · 0.85
normalizeVNodeFunction · 0.85
isSameVNodeTypeFunction · 0.85
patchFunction · 0.85
unmountFunction · 0.85
getSequenceFunction · 0.85
moveFunction · 0.85
getMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected