Bug 1321394 - Remove unnecessary loop in nsRubyBaseContainerFrame. r=dholbert
MozReview-Commit-ID: DqRD0w823Sv
--- a/layout/generic/nsRubyBaseContainerFrame.cpp
+++ b/layout/generic/nsRubyBaseContainerFrame.cpp
@@ -763,21 +763,20 @@ nsRubyBaseContainerFrame::PullOneColumn(
if (textFrame && !textFrame->IsIntraLevelWhitespace()) {
textFrame = nullptr;
}
}
} else {
// We are not pulling an intra-level whitespace, which means all
// elements we are going to pull can have non-whitespace content,
// which may contain float which we need to reparent.
- nsBlockFrame* oldFloatCB = nullptr;
- for (nsIFrame* frame : aColumn) {
- oldFloatCB = nsLayoutUtils::GetFloatContainingBlock(frame);
- break;
- }
+ MOZ_ASSERT(aColumn.begin() != aColumn.end(),
+ "Ruby column shouldn't be empty");
+ nsBlockFrame* oldFloatCB =
+ nsLayoutUtils::GetFloatContainingBlock(*aColumn.begin());
#ifdef DEBUG
MOZ_ASSERT(oldFloatCB, "Must have found a float containing block");
for (nsIFrame* frame : aColumn) {
MOZ_ASSERT(nsLayoutUtils::GetFloatContainingBlock(frame) == oldFloatCB,
"All frames in the same ruby column should share "
"the same old float containing block");
}
#endif