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:
committed by
Facebook Github Bot
parent
af5e6771d7
commit
d94363ea7e
@@ -209,10 +209,7 @@ static CSSSize _measure(
|
|||||||
float height,
|
float height,
|
||||||
CSSMeasureMode heightMode)
|
CSSMeasureMode heightMode)
|
||||||
{
|
{
|
||||||
const BOOL useExactWidth = (widthMode == CSSMeasureModeExactly);
|
if ((widthMode == CSSMeasureModeExactly) && (heightMode == CSSMeasureModeExactly)) {
|
||||||
const BOOL useExactHeight = (heightMode == CSSMeasureModeExactly);
|
|
||||||
|
|
||||||
if (useExactHeight && useExactWidth) {
|
|
||||||
return (CSSSize) {
|
return (CSSSize) {
|
||||||
.width = width,
|
.width = width,
|
||||||
.height = height,
|
.height = height,
|
||||||
@@ -226,8 +223,8 @@ static CSSSize _measure(
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
return (CSSSize) {
|
return (CSSSize) {
|
||||||
.width = useExactWidth ? width : sizeThatFits.width,
|
.width = sizeThatFits.width,
|
||||||
.height = useExactHeight ? height : sizeThatFits.height,
|
.height = sizeThatFits.height,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user