if (childList == nsnull) { childList = lastChild = aChild; } else { NS_ASSERTION(aChild != lastChild, "Same frame being added to frame list twice?"); lastChild->SetNextSibling(aChild); lastChild = aChild; }  for (nsIFrame* sib = lastChild->GetNextSibling(); sib; sib = sib->GetNextSibling()) { NS_ASSERTION(oldLastChild != sib, "Loop in frame list"); lastChild = sib; }
return NS_OK;
nsFrameItems::AddChild(nsIFrame* aChild){#ifdef DEBUG  nsIFrame* oldLastChild = lastChild;#endif    if (childList == nsnull) {    childList = lastChild = aChild;  }  else  {    NS_ASSERTION(aChild != lastChild,                 "Same frame being added to frame list twice?");    lastChild->SetNextSibling(aChild);    lastChild = aChild;  }  // if aChild has siblings, lastChild needs to be the last one  for (nsIFrame* sib = lastChild->GetNextSibling(); sib;       sib = sib->GetNextSibling()) {    NS_ASSERTION(oldLastChild != sib, "Loop in frame list");    lastChild = sib;  }}