Skip to content

Commit b916bd8

Browse files
CopilotL3P3
andcommitted
Remove redundant child.dom checks since hook_dom is now required
Co-authored-by: L3P3 <4629449+L3P3@users.noreply.github.com>
1 parent 0c1d989 commit b916bd8

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/lui.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -980,15 +980,13 @@ const instance_render = (dom_parent, dom_first) => {
980980
!child.dom &&
981981
error('node_map item components must call hook_dom() to define their root DOM element');
982982

983-
child.dom &&
984-
dom_parent.insertBefore(
985-
child.dom_first = child.dom,
986-
dom_first
987-
);
983+
dom_parent.insertBefore(
984+
child.dom_first = child.dom,
985+
dom_first
986+
);
988987
}
989988
else {
990989
if (
991-
child.dom &&
992990
child.dom.nextSibling !== dom_first
993991
) {
994992
VERBOSE && log('item reinsert ' + key);
@@ -1025,11 +1023,8 @@ const instance_render = (dom_parent, dom_first) => {
10251023
}
10261024
}
10271025

1028-
(
1029-
childs[child.parent_index = items_index] = child
1030-
).dom_first && (
1031-
dom_first = child.dom_first
1032-
);
1026+
childs[child.parent_index = items_index] = child;
1027+
dom_first = child.dom_first;
10331028
}
10341029

10351030
instance.dom_first =

0 commit comments

Comments
 (0)