Made sure that the composite datasource cursor returns unique elements.

This commit is contained in:
waterson%netscape.com 1999-04-28 02:42:31 +00:00
Родитель c716be445f
Коммит adb997b56f
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -334,6 +334,16 @@ CompositeEnumeratorImpl::HasMoreElements(PRBool* aResult)
// If we get here, then we've really found one. It'll
// remain cached in mResult until GetNext() sucks it out.
*aResult = PR_TRUE;
// Remember that we returned it, so we don't return
// duplicates.
// XXX I wonder if we should make unique-checking be
// optional. This could get to be pretty expensive (this
// implementation turns iteration into O(n^2)).
mAlreadyReturned.AppendElement(mResult);
NS_ADDREF(mResult);
return NS_OK;
} while (1);