From 34c97b03f6bd881a88dc86cbe00ba11e22aafead Mon Sep 17 00:00:00 2001 From: Lukas Woehrl Date: Wed, 21 Dec 2016 07:25:23 +0100 Subject: [PATCH] dedup code --- yoga/Yoga.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/yoga/Yoga.c b/yoga/Yoga.c index 73fc40c9..722f9b56 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -417,16 +417,6 @@ inline float YGNodeStyleGetFlexShrink(const YGNodeRef node) { return 0.0f; } -inline YGValue YGNodeStyleGetFlexBasis(const YGNodeRef node) { - if (node->style.flexBasis.isDefined) { - return node->style.flexBasis; - } - if (!YGFloatIsUndefined(node->style.flex) && node->style.flex > 0.0f) { - return YGValueZero; - } - return YGValueUndefined; -} - static inline const YGValue * YGNodeStyleGetFlexBasisPtr(const YGNodeRef node) { if (node->style.flexBasis.isDefined) { return &node->style.flexBasis; @@ -437,6 +427,10 @@ static inline const YGValue * YGNodeStyleGetFlexBasisPtr(const YGNodeRef node) { return &YGValueUndefined; } +inline YGValue YGNodeStyleGetFlexBasis(const YGNodeRef node) { + return *YGNodeStyleGetFlexBasisPtr(node); +} + void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) { if (node->style.flex != flex) { node->style.flex = flex;