Cleanup Measure method.

Summary: We have redundant/dead code in UIKit's sizing method, lets clean it up.

Reviewed By: emilsjolander

Differential Revision: D4110939

fbshipit-source-id: 35e856aa6c60fd24316bc67cc564f7eec2d9d714
This commit is contained in:
Dustin Shahidehpour
2016-11-02 17:05:06 -07:00
committed by Facebook Github Bot
parent af5e6771d7
commit d94363ea7e

View File

@@ -209,10 +209,7 @@ static CSSSize _measure(
float height,
CSSMeasureMode heightMode)
{
const BOOL useExactWidth = (widthMode == CSSMeasureModeExactly);
const BOOL useExactHeight = (heightMode == CSSMeasureModeExactly);
if (useExactHeight && useExactWidth) {
if ((widthMode == CSSMeasureModeExactly) && (heightMode == CSSMeasureModeExactly)) {
return (CSSSize) {
.width = width,
.height = height,
@@ -226,8 +223,8 @@ static CSSSize _measure(
}];
return (CSSSize) {
.width = useExactWidth ? width : sizeThatFits.width,
.height = useExactHeight ? height : sizeThatFits.height,
.width = sizeThatFits.width,
.height = sizeThatFits.height,
};
}