From 167760fb246ad39a0062846cc618f4924056a154 Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Sun, 9 Aug 2015 23:36:34 -0700 Subject: [PATCH] Do not use `update` in map if iteratee is a function Performance bump, especially while curry is slow. --- lib/map.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/map.js b/lib/map.js index ecf016b..e703814 100644 --- a/lib/map.js +++ b/lib/map.js @@ -18,7 +18,10 @@ function clone(object) { } function map(iteratee, object) { - const updater = update(iteratee); + const updater = typeof iteratee === 'function' ? + iteratee : + update(iteratee); + let newObject; forEach(object, (value, index) => {