refs #481 Removed old randomElements.

This commit is contained in:
Mathew Sutcliffe
2015-10-03 00:14:50 +01:00
parent 86913471a9
commit e3319f0dae
2 changed files with 0 additions and 34 deletions

View File

@@ -338,23 +338,6 @@ namespace BlackMisc
*/
void remove(const CCollection &other) { *this = CCollection(*this).difference(other); }
/*!
* \brief Return some random elements from container
* \param elements how many elements
*/
CCollection randomElements(int elements) const
{
if (this->isEmpty() || elements < 1) { return CCollection(); }
int high = this->size();
CCollection r;
for (int i = 0; i < elements; i++)
{
int randomIndex = qrand() % high;
r.push_back(*(this->begin()+ randomIndex));
}
return r;
}
/*!
* \brief Test for equality.
*/