Prefer prefix ++/-- on non-primitive types

Postfix ++/-- might cause the creation of a tmp instance
that might be optimized out. Mights are bad. Prefix doesn't
have this problem.
This commit is contained in:
Michael Cook (mackal)
2014-01-13 22:14:02 -05:00
parent 47c33f3b31
commit 4216627604
51 changed files with 405 additions and 426 deletions
+3 -3
View File
@@ -38,7 +38,7 @@ void ClientLogs::subscribe(EQEMuLog::LogIDs id, Client *c) {
std::vector<Client *>::iterator cur,end;
cur = entries[id].begin();
end = entries[id].end();
for(; cur != end; cur++) {
for(; cur != end; ++cur) {
if(*cur == c) {
printf("%s was allready subscribed to %d\n", c->GetName(), id);
return;
@@ -58,7 +58,7 @@ void ClientLogs::unsubscribe(EQEMuLog::LogIDs id, Client *c) {
std::vector<Client *>::iterator cur,end;
cur = entries[id].begin();
end = entries[id].end();
for(; cur != end; cur++) {
for(; cur != end; ++cur) {
if(*cur == c) {
entries[id].erase(cur);
return;
@@ -97,7 +97,7 @@ void ClientLogs::msg(EQEMuLog::LogIDs id, const char *buf) {
std::vector<Client *>::iterator cur,end;
cur = entries[id].begin();
end = entries[id].end();
for(; cur != end; cur++) {
for(; cur != end; ++cur) {
if(!(*cur)->InZone())
continue;
(*cur)->Message(CLIENT_LOG_CHANNEL, buf);