mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #481 Removed old randomElements.
This commit is contained in:
@@ -518,23 +518,6 @@ namespace BlackMisc
|
||||
return sorted(BlackMisc::Predicates::MemberLess(key1, keys...));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Return some random elements from container
|
||||
* \param elements how many elements
|
||||
*/
|
||||
CSequence randomElements(int elements) const
|
||||
{
|
||||
if (this->isEmpty() || elements < 1) { return CSequence(); }
|
||||
int high = this->size();
|
||||
CSequence r;
|
||||
for (int i = 0; i < elements; i++)
|
||||
{
|
||||
int randomIndex = qrand() % high;
|
||||
r.push_back(this->operator [](randomIndex));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
//! Equals operator.
|
||||
friend bool operator ==(const CSequence &a, const CSequence &b)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user