~compiz-team/compiz/compiz.fix_1088399

« back to all changes in this revision

Viewing changes to plugins/trailfocus/src/trailfocus.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:
150
150
    CompWindow             *best = NULL;
151
151
    TfWindowList::iterator iter;
152
152
    int                    distance, bestDist = 1000000;
153
 
    unsigned int           i;
154
153
 
155
154
    for (iter = windows.begin (); iter != windows.end (); ++iter)
156
155
        if (*iter == tw)
178
177
            continue;
179
178
 
180
179
        /* we do not want any windows already present in the list */
181
 
        for (i = 0; i < windows.size (); i++)
 
180
        for (unsigned int i = 0; i < windows.size (); i++)
182
181
        {
183
182
            if (windows[i]->window == cur)
184
183
            {