diff --git a/cocos/base/CCMap.h b/cocos/base/CCMap.h index dab3b729c0..097e33992c 100644 --- a/cocos/base/CCMap.h +++ b/cocos/base/CCMap.h @@ -282,7 +282,6 @@ public: { if (!_data.empty()) { - srand(time(NULL)); ssize_t randIdx = rand() % _data.size(); iterator randIter = _data.begin(); std::advance(randIter , randIdx); diff --git a/cocos/base/CCVector.h b/cocos/base/CCVector.h index e420012001..d751479d23 100644 --- a/cocos/base/CCVector.h +++ b/cocos/base/CCVector.h @@ -229,7 +229,6 @@ public: { if (!_data.empty()) { - srand(time(NULL)); ssize_t randIdx = rand() % _data.size(); return *(_data.begin() + randIdx); }