Skip to content

Commit aa04b5f

Browse files
committed
Bug 1979643 - Modernize a for-loop in nsGridContainerFrame::Tracks::FindFrUnitSize r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D258879
1 parent db6a9bc commit aa04b5f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

layout/generic/nsGridContainerFrame.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7379,16 +7379,15 @@ float nsGridContainerFrame::Tracks::FindFrUnitSize(
73797379

73807380
// 12.7.1.2: If flexFactorSum is less than 1, set it to 1 instead.
73817381
hypotheticalFrSize = leftOverSpace / std::max(flexFactorSum, 1.0f);
7382-
for (uint32_t i = 0, len = flexTracks.Length(); i < len; ++i) {
7383-
uint32_t track = flexTracks[i];
7382+
for (uint32_t& track : flexTracks) {
73847383
if (track == kAutoLine) {
73857384
continue; // Track marked as inflexible in a prev. iter of this loop.
73867385
}
73877386
float flexFactor = aFunctions.MaxSizingFor(track).AsFr();
73887387
const nscoord base = mSizes[track].mBase;
73897388
if (flexFactor * hypotheticalFrSize < base) {
73907389
// 12.7.1.4: Treat this track as inflexible.
7391-
flexTracks[i] = kAutoLine;
7390+
track = kAutoLine;
73927391
flexFactorSum -= flexFactor;
73937392
leftOverSpace -= base;
73947393
--numFlexTracks;

0 commit comments

Comments
 (0)