refactor(ivy): remove duplicated TNode utility (#32495)

Before this refactoring we had 2 utility functions to check if a given
TNode has matching directives. This PR leaves just one such function
(one that does less memory read).

PR Close #32495
This commit is contained in:
Pawel Kozlowski
2019-09-05 14:03:45 +02:00
committed by Kara Erickson
parent 024765b86a
commit 6674746e86
3 changed files with 4 additions and 12 deletions

View File

@ -117,13 +117,6 @@ export function getNativeByTNodeOrNull(tNode: TNode, lView: LView): RNode|null {
}
/**
* A helper function that returns `true` if a given `TNode` has any matching directives.
*/
export function hasDirectives(tNode: TNode): boolean {
return tNode.directiveEnd > tNode.directiveStart;
}
export function getTNode(index: number, view: LView): TNode {
ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');
ngDevMode && assertLessThan(index, view[TVIEW].data.length, 'wrong index for TNode');