~vanvugt/compiz/blacklist

« back to all changes in this revision

Viewing changes to plugins/scaleaddon/src/scaleaddon.cpp

Minor Performance Optimizations:

* Return ASAP./Prevent executing any unnecessary operations if we return.
* Used De Morgan's laws to merge and simplify if statements.

Other Changes:

* C++ Style: Declared iterator variables inside the for loops they are used in.
* No logic changes have been made.

Approved by Daniel van Vugt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
570
570
                               int        x,
571
571
                               int        y)
572
572
{
573
 
    int    i;
574
573
    int    x1, y1, x2, y2;
575
574
    int    overlapX, overlapY;
576
575
    int    xMin, xMax, yMin, yMax;
584
583
    x2 = x1 + WIN_W (ss->windows[win]) * as->scale;
585
584
    y2 = y1 + WIN_H (ss->windows[win]) * as->scale;
586
585
 
587
 
    for (i = 0; i < ss->nWindows; i++)
 
586
    for (int i = 0; i < ss->nWindows; i++)
588
587
    {
589
588
        if (i == win)
590
589
            continue;