From 85031baaf263cf518fbac085f425a43073dbad94 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 17 Aug 2018 03:56:43 -0700 Subject: [PATCH] Replace percent setter in `YG_NODE_STYLE_PROPERTY_UNIT_IMPL` macro with template code Reviewed By: astreet Differential Revision: D8874732 fbshipit-source-id: 46fdf851f19f16def0c7e2ab4c5f17a349dc7aee --- yoga/Yoga.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 03185fb3..7a115a90 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -648,16 +648,8 @@ struct DimensionProp { \ void YGNodeStyleSet##name##Percent( \ const YGNodeRef node, const type paramName) { \ - YGValue value = { \ - YGFloatSanitize(paramName), \ - YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPercent, \ - }; \ - if ((node->getStyle().instanceName[dimension].value != value.value && \ - value.unit != YGUnitUndefined) || \ - node->getStyle().instanceName[dimension].unit != value.unit) { \ - node->getStyle().instanceName[dimension] = value; \ - node->markDirtyAndPropogate(); \ - } \ + DimensionProp<&YGStyle::instanceName>::set( \ + node, paramName); \ } #define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \