~uriboni/compiz/unminimize-configurable-independently

« back to all changes in this revision

Viewing changes to plugins/compiztoolbox/src/compiztoolbox.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:
267
267
    if (!grabIndex)
268
268
        return NULL;
269
269
 
270
 
    for (it = windows.begin (); it != windows.end (); it++, cur++)
 
270
    for (it = windows.begin (); it != windows.end (); ++it, ++cur)
271
271
    {
272
272
        if (*it == selectedWindow)
273
273
            break;
278
278
 
279
279
    if (toNext)
280
280
    {
281
 
        it++;
 
281
        ++it;
282
282
        if (it == windows.end ())
283
283
            w = windows.front ();
284
284
        else