Change the return type of getMarginForAxis to YGFloatOptional

Summary: Change the return type of getMarginForAxis to YGFloatOptional

Reviewed By: emilsjolander

Differential Revision: D7350337

fbshipit-source-id: dd1ee2fcd295ccd14f7d414ab0c24090b24e91e0
This commit is contained in:
Pritesh Nandgaonkar
2018-04-04 07:55:54 -07:00
committed by Facebook Github Bot
parent 3c6c10075a
commit bad262b961
3 changed files with 73 additions and 64 deletions

View File

@@ -165,12 +165,10 @@ YGFloatOptional YGNode::getTrailingMargin(
widthSize);
}
// TODO: Make its return type to YGFloatOptional
float YGNode::getMarginForAxis(
const YGFlexDirection axis,
const float widthSize) const {
return YGUnwrapFloatOptional(
getLeadingMargin(axis, widthSize) + getTrailingMargin(axis, widthSize));
YGFloatOptional YGNode::getMarginForAxis(
const YGFlexDirection& axis,
const float& widthSize) const {
return getLeadingMargin(axis, widthSize) + getTrailingMargin(axis, widthSize);
}
// Setters