Skip to content

Commit

Permalink
refactor(ivy): remove isRootView check from getRenderParent (#33988)
Browse files Browse the repository at this point in the history
The root view case is already covered by the existing code in the
getRenderParent function so no need to have an explicit checks
(and associated memory reads) again.

PR Close #33988
  • Loading branch information
pkozlowski-opensource authored and matsko committed Nov 25, 2019
1 parent f2800b9 commit 04b12fc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions packages/core/src/render3/node_manipulation.ts
Expand Up @@ -17,7 +17,7 @@ import {NodeInjectorFactory} from './interfaces/injector';
import {TElementNode, TNode, TNodeFlags, TNodeType, TProjectionNode, TViewNode, unusedValueExportToPlacateAjd as unused2} from './interfaces/node';
import {unusedValueExportToPlacateAjd as unused3} from './interfaces/projection';
import {ProceduralRenderer3, RElement, RNode, RText, Renderer3, isProceduralRenderer, unusedValueExportToPlacateAjd as unused4} from './interfaces/renderer';
import {isLContainer, isLView, isRootView} from './interfaces/type_checks';
import {isLContainer, isLView} from './interfaces/type_checks';
import {CHILD_HEAD, CLEANUP, DECLARATION_COMPONENT_VIEW, DECLARATION_LCONTAINER, FLAGS, HOST, HookData, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, TVIEW, T_HOST, unusedValueExportToPlacateAjd as unused5} from './interfaces/view';
import {assertNodeOfPossibleTypes, assertNodeType} from './node_assert';
import {getLViewParent} from './util/view_traversal_utils';
Expand Down Expand Up @@ -503,11 +503,6 @@ function executeOnDestroys(view: LView): void {
* into destination.
*/
function getRenderParent(tNode: TNode, currentView: LView): RElement|null {
// Nodes of the top-most view can be inserted eagerly.
if (isRootView(currentView)) {
return nativeParentNode(currentView[RENDERER], getNativeByTNode(tNode, currentView));
}

// Skip over element and ICU containers as those are represented by a comment node and
// can't be used as a render parent.
let parentTNode = tNode.parent;
Expand Down
Expand Up @@ -497,9 +497,6 @@
{
"name": "isProceduralRenderer"
},
{
"name": "isRootView"
},
{
"name": "isStylingContext"
},
Expand Down
Expand Up @@ -365,9 +365,6 @@
{
"name": "isProceduralRenderer"
},
{
"name": "isRootView"
},
{
"name": "leaveDI"
},
Expand Down

0 comments on commit 04b12fc

Please sign in to comment.