From e3319f0dae347db0eb8653d59df8a7e3006cbd91 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sat, 3 Oct 2015 00:14:50 +0100 Subject: [PATCH] refs #481 Removed old randomElements. --- src/blackmisc/collection.h | 17 ----------------- src/blackmisc/sequence.h | 17 ----------------- 2 files changed, 34 deletions(-) diff --git a/src/blackmisc/collection.h b/src/blackmisc/collection.h index 0eafccb2c..b0e0a4de5 100644 --- a/src/blackmisc/collection.h +++ b/src/blackmisc/collection.h @@ -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. */ diff --git a/src/blackmisc/sequence.h b/src/blackmisc/sequence.h index 50636de99..ccc6826d7 100644 --- a/src/blackmisc/sequence.h +++ b/src/blackmisc/sequence.h @@ -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) {