~timo-jyrinki/compiz/metacity-key-migrations

« back to all changes in this revision

Viewing changes to plugins/ezoom/src/ezoom.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:
1480
1480
                          CompOption::Vector options,
1481
1481
                          float              target)
1482
1482
{
1483
 
    int          x, y;
1484
1483
    int          out = screen->outputDeviceForPoint (pointerX, pointerY);
1485
1484
    CompWindow   *w;
1486
1485
 
1499
1498
    }
1500
1499
    else
1501
1500
    {
1502
 
        x = CompOption::getIntOptionNamed (options, "x", 0);
1503
 
        y = CompOption::getIntOptionNamed (options, "y", 0);
 
1501
        int x = CompOption::getIntOptionNamed (options, "x", 0);
 
1502
        int y = CompOption::getIntOptionNamed (options, "y", 0);
1504
1503
        setCenter (x, y, false);
1505
1504
    }
1506
1505