Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d04c38c

Browse files
dchermanNarretz
authored andcommitted
perf(ngRepeat): avoid duplicate jqLite wrappers
Internally, `$animate` already wraps elements passed through with `jqLite`, so we can avoid needless duplication here.
1 parent bdc5a1c commit d04c38c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/ng/directive/ngRepeat.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
508508

509509
if (getBlockStart(block) != nextNode) {
510510
// existing item which got moved
511-
$animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));
511+
$animate.move(getBlockNodes(block.clone), null, previousNode);
512512
}
513513
previousNode = getBlockEnd(block);
514514
updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
@@ -520,8 +520,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
520520
var endNode = ngRepeatEndComment.cloneNode(false);
521521
clone[clone.length++] = endNode;
522522

523-
// TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?
524-
$animate.enter(clone, null, jqLite(previousNode));
523+
$animate.enter(clone, null, previousNode);
525524
previousNode = endNode;
526525
// Note: We only need the first/last node of the cloned nodes.
527526
// However, we need to keep the reference to the jqlite wrapper as it might be changed later

0 commit comments

Comments
 (0)