~uriboni/compiz/unminimize-configurable-independently

« back to all changes in this revision

Viewing changes to src/timer/src/timer.cpp

Fixed various problems described in bug 1030473.
Optimized performance and style following suggestions reported by cppcheck:

1. Reduced the scope of various variables.

2. Used prefix ++ operators for non-primitive types, because those can be more efficient than post-increment. Post-increment usually keeps a copy of the previous value, adds extra code and is slower.. Fixes: https://bugs.launchpad.net/bugs/1030473. Approved by Daniel van Vugt, Sam Spilsbury.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
                break;
110
110
            if (t->maxLeft () < (unsigned int) timeout)
111
111
                timeout = (int) t->maxLeft ();
112
 
            it++;
 
112
            ++it;
113
113
        }
114
114
    }
115
115
    else
152
152
    }
153
153
 
154
154
    std::list<CompTimer*>::const_iterator i = requeue.begin ();
155
 
    for (; i != requeue.end (); i++)
 
155
    for (; i != requeue.end (); ++i)
156
156
    {
157
157
        CompTimer *t = *i;
158
158
        handler->addTimer (t);