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

Commit 2e3c640

Browse files
dchermanlgalfaso
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 b04871b commit 2e3c640

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/ng/directive/ngRepeat.js

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

522522
if (getBlockStart(block) != nextNode) {
523523
// existing item which got moved
524-
$animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));
524+
$animate.move(getBlockNodes(block.clone), null, previousNode);
525525
}
526526
previousNode = getBlockEnd(block);
527527
updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
@@ -533,8 +533,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
533533
var endNode = ngRepeatEndComment.cloneNode(false);
534534
clone[clone.length++] = endNode;
535535

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

0 commit comments

Comments
 (0)