From cd7cc7d640048df7b0f63a569cfa6cd36a2ae3c0 Mon Sep 17 00:00:00 2001 From: ericlewis Date: Mon, 25 Feb 2019 11:30:51 -0800 Subject: [PATCH] Fix deadstore in RCTSpringAnimation (#23643) Summary: Fixes an unused storage of variable. [iOS] [Fixed] - Fix deadstore in RCTSpringAnimation Pull Request resolved: https://github.com/facebook/react-native/pull/23643 Differential Revision: D14211089 Pulled By: hramos fbshipit-source-id: 640d46be25f03d766698f6e85490c7d1a6a019fc --- Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m b/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m index b7e784b6c..179a18787 100644 --- a/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m +++ b/Libraries/NativeAnimation/Drivers/RCTSpringAnimation.m @@ -113,14 +113,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) } // calculate delta time - NSTimeInterval deltaTime; if(_animationStartTime == -1) { _t = 0.0; _animationStartTime = currentTime; - deltaTime = 0.0; } else { // Handle frame drops, and only advance dt by a max of MAX_DELTA_TIME - deltaTime = MIN(MAX_DELTA_TIME, currentTime - _animationCurrentTime); + NSTimeInterval deltaTime = MIN(MAX_DELTA_TIME, currentTime - _animationCurrentTime); _t = _t + deltaTime / RCTAnimationDragCoefficient(); }