Skip to content

Commit 6104b2e

Browse files
Michael StramelMichael Stramel
authored andcommitted
refactor(array): change shift to pop for performance
1 parent 73e5659 commit 6104b2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/directives/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ angular.module('schemaForm').directive('sfArray', ['sfSelect', 'schemaForm', 'sf
170170
// Apparently the fastest way to clear an array, readable too.
171171
// http://jsperf.com/array-destroy/32
172172
while (arr.length > 0) {
173-
arr.shift();
173+
arr.pop();
174174
}
175175

176176
form.titleMap.forEach(function(item, index) {

0 commit comments

Comments
 (0)