refactor: merge bitwise flag checks (#4324)

This commit is contained in:
Hazlank
2021-08-16 14:13:04 -05:00
committed by GitHub
parent e936898abd
commit 6db15a27cf
4 changed files with 8 additions and 15 deletions

View File

@@ -984,8 +984,7 @@ function baseCreateRenderer(
// which also requires the correct parent container
!isSameVNodeType(oldVNode, newVNode) ||
// - In the case of a component, it could contain anything.
oldVNode.shapeFlag & ShapeFlags.COMPONENT ||
oldVNode.shapeFlag & ShapeFlags.TELEPORT)
oldVNode.shapeFlag & (ShapeFlags.COMPONENT | ShapeFlags.TELEPORT))
? hostParentNode(oldVNode.el)!
: // In other cases, the parent container is not actually used so we
// just pass the block element here to avoid a DOM parentNode call.
@@ -2129,8 +2128,8 @@ function baseCreateRenderer(
)
} else if (
(type === Fragment &&
(patchFlag & PatchFlags.KEYED_FRAGMENT ||
patchFlag & PatchFlags.UNKEYED_FRAGMENT)) ||
patchFlag &
(PatchFlags.KEYED_FRAGMENT | PatchFlags.UNKEYED_FRAGMENT)) ||
(!optimized && shapeFlag & ShapeFlags.ARRAY_CHILDREN)
) {
unmountChildren(children as VNode[], parentComponent, parentSuspense)