From 874ee4d2e19203807c8424fc4ab80609f3e8fb00 Mon Sep 17 00:00:00 2001 From: Pablo Iacopi Date: Mon, 18 Oct 2021 17:23:04 -0300 Subject: [PATCH] Removed unnecessary int cast to avoid Integer allocations --- .../lottie/animation/keyframe/ColorKeyframeAnimation.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java b/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java index 63030753ea..3c83b2684a 100644 --- a/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java +++ b/lottie/src/main/java/com/airbnb/lottie/animation/keyframe/ColorKeyframeAnimation.java @@ -24,19 +24,17 @@ public int getIntValue(Keyframe keyframe, float keyframeProgress) { if (keyframe.startValue == null || keyframe.endValue == null) { throw new IllegalStateException("Missing values for keyframe."); } - int startColor = keyframe.startValue; - int endColor = keyframe.endValue; if (valueCallback != null) { //noinspection ConstantConditions - Integer value = valueCallback.getValueInternal(keyframe.startFrame, keyframe.endFrame, startColor, - endColor, keyframeProgress, getLinearCurrentKeyframeProgress(), getProgress()); + Integer value = valueCallback.getValueInternal(keyframe.startFrame, keyframe.endFrame, keyframe.startValue, + keyframe.endValue, keyframeProgress, getLinearCurrentKeyframeProgress(), getProgress()); if (value != null) { return value; } } - return GammaEvaluator.evaluate(MiscUtils.clamp(keyframeProgress, 0f, 1f), startColor, endColor); + return GammaEvaluator.evaluate(MiscUtils.clamp(keyframeProgress, 0f, 1f), keyframe.startValue, keyframe.endValue); } /**