Closed Bug 1604009 Opened 5 years ago Closed 5 years ago

Dead assignments in nsGridRowGroupLayout::CountRowsColumns and nsGridRowGroupLayout::BuildRows

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: alexhenrie24, Assigned: alexhenrie24)

Details

Attachments

(1 file)

nsGridRowGroupLayout::CountRowsColumns currently has a loop that looks like this:

while (child) {
  // first see if it is a scrollframe. If so walk down into it and get the
  // scrolled child
  nsIFrame* deepChild = nsGrid::GetScrolledBox(child);

  nsIGridPart* monument = nsGrid::GetPartFromBox(deepChild);
  if (monument) {
    monument->CountRowsColumns(deepChild, aRowCount, aComputedColumnCount);
    child = nsBox::GetNextXULBox(child);
    deepChild = child;
    continue;
  }

  child = nsBox::GetNextXULBox(child);

  // if not a monument. Then count it. It will be a bogus row
  aRowCount++;
}

The assignment to deepChild before the continue statement is pointless because deepChild is always set at the beginning of the loop. This assignment has been a dead assignment since before Mozilla moved to Mercurial in 2007 and can be safely removed.

There is also a nearly-identical loop in nsGridRowGroupLayout::BuildRows with the same problem.

Assignee: nobody → alexhenrie24
Status: NEW → ASSIGNED
Pushed by dbaron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e6a4e221495 Remove dead assignments from nsGridRowGroupLayout functions. r=dbaron
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: