optim: changed postfixed ++ into prefix++ for non trivial operators, replaced test on std::list::size() by std::list::empty() (Patch from Phenom, modified)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7627 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-10-21 22:33:02 +00:00
parent 491a655889
commit b593a918a0
99 changed files with 571 additions and 571 deletions

View file

@ -1213,7 +1213,7 @@ bool ftController::FileRequest(const std::string& fname, const RsFileHash& hash
setPeerState(dit->second->mTransfer, *it, rate, mServiceCtrl->isPeerConnected(mFtServiceId, *it));
}
if (srcIds.size() == 0)
if (srcIds.empty())
{
#ifdef CONTROL_DEBUG
std::cerr << "ftController::FileRequest() WARNING: No Src Peers";

View file

@ -315,7 +315,7 @@ bool ftDataMultiplex::doWork()
{
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
if (mRequestQueue.size() == 0)
if (mRequestQueue.empty())
{
doRequests = false;
continue;
@ -385,7 +385,7 @@ bool ftDataMultiplex::doWork()
{
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
if (mSearchQueue.size() == 0)
if (mSearchQueue.empty())
{
/* Finished */
return true;

View file

@ -114,7 +114,7 @@ void ftExtraList::hashAFile()
{
RsStackMutex stack(extMutex);
if (mToHash.size() == 0)
if (mToHash.empty())
return;
details = mToHash.front();

View file

@ -376,7 +376,7 @@ int ftFileCreator::locked_notifyReceived(uint64_t offset, uint32_t chunk_size)
// all parts are obtained.
// - new parts arriving in the second part cannot interfere since they should come in order.
(*chunk.ref_cnt)++ ;
++(*chunk.ref_cnt) ;
#ifdef FILE_DEBUG
std::cerr << "Created two sub chunks. Ref_cnt = " << *chunk.ref_cnt << std::endl;