Avoid repeated value read in SubtractionAnimatedNode

Summary:
Minor optimization, but spotted this while reviewing the implementation for D33622997

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33622996

fbshipit-source-id: 8712753803fc46e6a046d50f77454a813e4a641a
This commit is contained in:
Pieter De Baets authored and Facebook GitHub Bot committed 2022-01-18 13:53:43 -08:00
1 parent b2105711a0
commit 08e76772fe
5 files changed
+8 -8

No files matched your search

@@ -38,12 +38,12 @@ import com.facebook.react.bridge.ReadableMap;
double value = ((ValueAnimatedNode) animatedNode).getValue();
if (i == 0) {
mValue = value;
continue;
} else {
mValue -= value;
}
mValue -= ((ValueAnimatedNode) animatedNode).getValue();
} else {
throw new JSApplicationCausedNativeException(
"Illegal node ID set as an input for " + "Animated.subtract node");
"Illegal node ID set as an input for Animated.subtract node");
}
}
}