JavaScript animation engine
Optimise getInstanceTiming()
Julian Garnierb6d65e5aa705
diff --git a/anime.js b/anime.jsindex 5415ab07..03f35319 100644--- a/anime.js+++ b/anime.js@@ -641,9 +641,8 @@function getInstanceTimings(type, animations, instanceSettings, tweenSettings) {const isDelay = (type === 'delay');- const math = isDelay ? Math.min : Math.max;if (animations.length) {- return math.apply(Math, animations.map(anim => anim[type]));+ return (isDelay ? Math.min : Math.max).apply(Math, animations.map(anim => anim[type]));} else {return isDelay ? tweenSettings.delay : instanceSettings.offset + tweenSettings.delay + tweenSettings.duration;}