void DocumentSourceSort::populate() { /* make sure we've got a sort key */ verify(vSortKey.size()); if (!limitSrc) populateAll(); else if (limitSrc->getLimit() == 1) populateOne(); else populateTopK(); populated = true; }
void DocumentSourceSort::populate() { /* make sure we've got a sort key */ verify(vSortKey.size()); if (!limitSrc) populateAll(); else if (limitSrc->getLimit() == 1) populateOne(); else populateTopK(); /* start the sort iterator */ docIterator = documents.begin(); if (docIterator != documents.end()) pCurrent = docIterator->doc; populated = true; }