Eliminate double call of shadowNodeFromValue in dispatchCommand (#35695)

Summary:
This PR slightly improves the implementation of `dispatchCommand` method of `UIManagerBinding` to use existing variable `shadowNode` instead of calling `shadowNodeFromValue` again.

## Changelog

[INTERNAL] [CHANGED] - Eliminated double call of `shadowNodeFromValue` in `dispatchCommand`

Pull Request resolved: https://github.com/facebook/react-native/pull/35695

Test Plan: Launch RNTester with Fabric enabled and check if `scrollTo` or some other command works properly.

Reviewed By: christophpurrer

Differential Revision: D42233216

Pulled By: robhogan

fbshipit-source-id: db152206060ff599962f47c43fda8ea797f2a8cb
This commit is contained in:
Tomek Zawadzki
2023-01-03 03:07:13 -08:00
committed by Facebook GitHub Bot
parent 4ac4a5c27d
commit 292268ea3f
@@ -493,7 +493,7 @@ jsi::Value UIManagerBinding::get(
auto shadowNode = shadowNodeFromValue(runtime, arguments[0]);
if (shadowNode) {
uiManager->dispatchCommand(
shadowNodeFromValue(runtime, arguments[0]),
shadowNode,
stringFromValue(runtime, arguments[1]),
commandArgsFromValue(runtime, arguments[2]));
}