Bug 1861562 Part 4 - Micro optimization in nsTableRowGroupFrame::InitChildReflowInput(). r=layout-reviewers,jfkthame

We don't need the type-casting if `aBorderCollapse` is false.

Differential Revision: https://phabricator.services.mozilla.com/D192051
This commit is contained in:
Ting-Yu Lin 2023-10-27 18:38:08 +00:00
parent 9fa842f014
commit da5d082209

View File

@ -296,10 +296,9 @@ void nsTableRowGroupFrame::InitChildReflowInput(nsPresContext* aPresContext,
ReflowInput& aReflowInput) {
const auto childWM = aReflowInput.GetWritingMode();
LogicalMargin border(childWM);
if (nsTableRowFrame* rowFrame = do_QueryFrame(aReflowInput.mFrame)) {
if (aBorderCollapse) {
border = rowFrame->GetBCBorderWidth(childWM);
}
if (aBorderCollapse) {
auto* rowFrame = static_cast<nsTableRowFrame*>(aReflowInput.mFrame);
border = rowFrame->GetBCBorderWidth(childWM);
}
const LogicalMargin zeroPadding(childWM);
aReflowInput.Init(aPresContext, Nothing(), Some(border), Some(zeroPadding));