Fabric: Using `traitCast` in UIManager
Summary: This is another perf-critical place where using traitCast should help with perf. After this change we practically will not have any `dynamic_cast`s (except those which will be delited (with methods where they are used) in the future diffs). Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D20052029 fbshipit-source-id: 63b589d3c3322f0afd72f18b4701fe31d0e05c2f
This commit is contained in:
Родитель
3400135487
Коммит
1090b05e61
|
@ -176,9 +176,9 @@ LayoutMetrics UIManager::getRelativeLayoutMetrics(
|
|||
}
|
||||
|
||||
auto layoutableShadowNode =
|
||||
dynamic_cast<const LayoutableShadowNode *>(&shadowNode);
|
||||
traitCast<LayoutableShadowNode const *>(&shadowNode);
|
||||
auto layoutableAncestorShadowNode =
|
||||
dynamic_cast<const LayoutableShadowNode *>(ancestorShadowNode);
|
||||
traitCast<LayoutableShadowNode const *>(ancestorShadowNode);
|
||||
|
||||
if (!layoutableShadowNode || !layoutableAncestorShadowNode) {
|
||||
return EmptyLayoutMetrics;
|
||||
|
|
Загрузка…
Ссылка в новой задаче