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:
Valentin Shergin 2020-02-26 22:03:14 -08:00 коммит произвёл Facebook Github Bot
Родитель 3400135487
Коммит 1090b05e61
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;