From 869ae4b3cf9836d67d5f8ea878f1d35c0531864a Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Wed, 31 May 2017 17:30:11 -0700 Subject: [PATCH] improve assign() util performance --- src/shared/utils.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/shared/utils.js b/src/shared/utils.js index edd1da3a14..9eb3ed2cee 100644 --- a/src/shared/utils.js +++ b/src/shared/utils.js @@ -1,10 +1,11 @@ export function noop () {} export function assign ( target ) { - for ( var i = 1; i < arguments.length; i += 1 ) { - var source = arguments[i]; - for ( var k in source ) target[k] = source[k]; + var k, source, i = 1, len = arguments.length; + for ( ; i < len; i++ ) { + source = arguments[i]; + for ( k in source ) target[k] = source[k]; } return target; -} \ No newline at end of file +}