From 88efbfc9ccfeeac30e56c29aa71522377431ae0a Mon Sep 17 00:00:00 2001 From: andyque Date: Fri, 3 Jan 2014 11:56:58 +0800 Subject: [PATCH] remove srand function call --- cocos/base/CCMap.h | 1 - cocos/base/CCVector.h | 1 - 2 files changed, 2 deletions(-) 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); }