Code review comment for lp://staging/~azzar1/unity/fix-bug-955158

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

There are a lot of identical expressions:

38 + _top_space->SetMinimumHeight((_anchor_height - TotalItemHeight) / 2 + _padding + _corner_radius + _offset_correction);
39 + _top_space->SetMaximumHeight((_anchor_height - TotalItemHeight) / 2 + _padding + _corner_radius + _offset_correction);
40 +
41 + _bottom_space->SetMinimumHeight((_anchor_height - TotalItemHeight) / 2 + _padding + _corner_radius);
42 + _bottom_space->SetMaximumHeight((_anchor_height - TotalItemHeight) / 2 + _padding + _corner_radius);

Please only compute each different expression once. Like...

int b = (_anchor_height - TotalItemHeight) / 2 + _padding + _corner_radius;
int t = b + _offset_correction;
_top_space->SetMinimumHeight(t);
_top_space->SetMaximumHeight(t);
_bottom_space->SetMinimumHeight(b);
_bottom_space->SetMaximumHeight(b);

review: Needs Fixing

« Back to merge proposal