Use for-loop to map arguments instead of slice
http://jsperf.com/arguments-slice-vs-for-loop-copy
This commit is contained in:
parent
1a473ee63e
commit
eac505aead
1 changed files with 5 additions and 1 deletions
|
|
@ -141,7 +141,11 @@
|
||||||
* or splat (optional)
|
* or splat (optional)
|
||||||
*/
|
*/
|
||||||
function m(tag, pairs) {
|
function m(tag, pairs) {
|
||||||
var args = [].slice.call(arguments, 1)
|
var args = []
|
||||||
|
|
||||||
|
for (var i = 1, length = arguments.length; i < length; i++) {
|
||||||
|
args[i - 1] = arguments[i]
|
||||||
|
}
|
||||||
|
|
||||||
if (isObject(tag)) return parameterize(tag, args)
|
if (isObject(tag)) return parameterize(tag, args)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue