mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 06:09:09 -04:00
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:
parent
491a655889
commit
b593a918a0
99 changed files with 571 additions and 571 deletions
|
@ -141,7 +141,7 @@ int p3ChatService::tick()
|
|||
std::vector<VisibleChatLobbyRecord> visible_lobbies_tmp ;
|
||||
getListOfNearbyChatLobbies(visible_lobbies_tmp) ;
|
||||
|
||||
if (visible_lobbies_tmp.size()==0){
|
||||
if (visible_lobbies_tmp.empty()){
|
||||
last_req_chat_lobby_list = now-LOBBY_LIST_AUTO_UPDATE_TIME+MIN_DELAY_BETWEEN_PUBLIC_LOBBY_REQ;
|
||||
} else {
|
||||
last_req_chat_lobby_list = now ;
|
||||
|
@ -1467,7 +1467,7 @@ bool p3ChatService::getPublicChatQueue(std::list<ChatInfo> &chats)
|
|||
RsStackMutex stack(mChatMtx); /********** STACK LOCKED MTX ******/
|
||||
|
||||
// get the items from the public list.
|
||||
if (publicList.size() == 0) {
|
||||
if (publicList.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -777,24 +777,24 @@ void p3MsgService::getMessageCount(unsigned int *pnInbox, unsigned int *pnInboxN
|
|||
initRsMIS(mit->second, mis);
|
||||
|
||||
if (mis.msgflags & RS_MSG_TRASH) {
|
||||
if (pnTrashbox) (*pnTrashbox)++;
|
||||
if (pnTrashbox) ++(*pnTrashbox);
|
||||
continue;
|
||||
}
|
||||
switch (mis.msgflags & RS_MSG_BOXMASK) {
|
||||
case RS_MSG_INBOX:
|
||||
if (pnInbox) (*pnInbox)++;
|
||||
if (pnInbox) ++(*pnInbox);
|
||||
if ((mis.msgflags & RS_MSG_NEW) == RS_MSG_NEW) {
|
||||
if (pnInboxNew) (*pnInboxNew)++;
|
||||
if (pnInboxNew) ++(*pnInboxNew);
|
||||
}
|
||||
break;
|
||||
case RS_MSG_OUTBOX:
|
||||
if (pnOutbox) (*pnOutbox)++;
|
||||
if (pnOutbox) ++(*pnOutbox);
|
||||
break;
|
||||
case RS_MSG_DRAFTBOX:
|
||||
if (pnDraftbox) (*pnDraftbox)++;
|
||||
if (pnDraftbox) ++(*pnDraftbox);
|
||||
break;
|
||||
case RS_MSG_SENTBOX:
|
||||
if (pnSentbox) (*pnSentbox)++;
|
||||
if (pnSentbox) ++(*pnSentbox);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1248,7 +1248,7 @@ bool p3MsgService::removeMessageTagType(uint32_t tagId)
|
|||
if (lit != tag->tagIds.end()) {
|
||||
tag->tagIds.erase(lit);
|
||||
|
||||
if (tag->tagIds.size() == 0) {
|
||||
if (tag->tagIds.empty()) {
|
||||
/* remove empty tag */
|
||||
delete(tag);
|
||||
|
||||
|
@ -1360,7 +1360,7 @@ bool p3MsgService::setMessageTag(const std::string &msgId, uint32_t tagId, bool
|
|||
tag->tagIds.erase(lit);
|
||||
nNotifyType = NOTIFY_TYPE_DEL;
|
||||
|
||||
if (tag->tagIds.size() == 0) {
|
||||
if (tag->tagIds.empty()) {
|
||||
/* remove empty tag */
|
||||
delete(tag);
|
||||
mMsgTags.erase(mit);
|
||||
|
|
|
@ -42,7 +42,7 @@ RsItem *p3Service::recvItem()
|
|||
{
|
||||
RsStackMutex stack(srvMtx); /***** LOCK MUTEX *****/
|
||||
|
||||
if (recv_queue.size() == 0)
|
||||
if (recv_queue.empty())
|
||||
{
|
||||
return NULL; /* nothing there! */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue