nsOutlinerRows::operator[](PRInt32 aRow) {    PRInt32 last = mLastRow.GetRowIndex(); if (last != -1) { if (aRow == last) return mLastRow; else if (last + 1 == aRow) return ++mLastRow; else if (last - 1 == aRow) return --mLastRow; }       iterator result; Subtree* current = &mRoot;  PRInt32 index = 0; result.SetRowIndex(aRow);  do { PRInt32 subtreeSize; Subtree* subtree = GetSubtreeFor(current, index, &subtreeSize);  if (subtreeSize >= aRow) { result.Push(current, index); current = subtree; index = 0; --aRow; } else { ++index; aRow -= subtreeSize + 1; } } while (aRow >= 0);  mLastRow = result; return result; }
Row& operator[](PRInt32 aIndex) { NS_PRECONDITION(aIndex >= 0 && aIndex < mCount, "bad index"); return mRows[aIndex]; }
nsOutlinerRows::operator[](PRInt32 aRow){    // See if we're just lucky, and end up with something    // nearby. (This tends to happen a lot due to the way that we get    // asked for rows n' stuff.)    PRInt32 last = mLastRow.GetRowIndex();    if (last != -1) {        if (aRow == last)            return mLastRow;        else if (last + 1 == aRow)            return ++mLastRow;        else if (last - 1 == aRow)            return --mLastRow;    }    // Nope. Construct a path to the specified index. This is a little    // bit better than O(n), because we can skip over subtrees. (So it    // ends up being approximately linear in the subtree size, instead    // of the entire view size. But, most of the time, big views are    // flat. Oh well.)    iterator result;    Subtree* current = &mRoot;    PRInt32 index = 0;    result.SetRowIndex(aRow);    do {        PRInt32 subtreeSize;        Subtree* subtree = GetSubtreeFor(current, index, &subtreeSize);        if (subtreeSize >= aRow) {            result.Push(current, index);            current = subtree;            index = 0;            --aRow;        }        else {            ++index;            aRow -= subtreeSize + 1;        }    } while (aRow >= 0);    mLastRow = result;    return result;}