goto done;  if (rv == NS_RDF_NO_VALUE)
ContainerCursorImpl::Advance(void){    nsresult rv;    // release the last value that we were holding    NS_IF_RELEASE(mCurrent);    nsIRDFNode* nextNode        = nsnull;    nsIRDFLiteral* nextVal      = nsnull;    nsXPIDLString p;    nsAutoString s;    PRInt32 last;    PRInt32 err;    // Figure out the upper bound so we'll know when we're done.    // XXX we could cache all this crap when the cursor gets created.    if (NS_FAILED(rv = mDataSource->GetTarget(mContainer, kRDF_nextVal, PR_TRUE, &nextNode)))        goto done;    if (NS_FAILED(rv = nextNode->QueryInterface(kIRDFLiteralIID, (void**) &nextVal)))        goto done;    if (NS_FAILED(rv = nextVal->GetValue(getter_Copies(p))))        goto done;    s = p;    last = s.ToInteger(&err);    if (NS_FAILED(err))        goto done;    // initialize rv to the case where mNextIndex has advanced past the    // last element    rv = NS_RDF_CURSOR_EMPTY;    while (mNextIndex < last) {        NS_IF_RELEASE(mOrdinalProperty);        if (NS_FAILED(rv = rdf_IndexToOrdinalResource(mNextIndex, &mOrdinalProperty)))            break;        rv = mDataSource->GetTarget(mContainer, mOrdinalProperty, PR_TRUE, &mCurrent);        if (NS_FAILED(rv)) return rv;        ++mNextIndex;        if (rv == NS_OK) {            // Don't bother releasing mCurrent; we'll let the AddRef            // serve as the implicit addref that GetNext() should            // perform.            break;        }    }done:    NS_IF_RELEASE(nextNode);    NS_IF_RELEASE(nextVal);    return rv;}