~didrocks/compiz/g-c-c-integration

« back to all changes in this revision

Viewing changes to plugins/snap/src/snap.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:
201
201
            {
202
202
                if (e->id == w->id ())
203
203
                    e->passed = true;
204
 
                it++;
 
204
                ++it;
205
205
                continue;
206
206
            }
207
207
 
244
244
            }
245
245
            else
246
246
            {
247
 
                it++;
 
247
                ++it;
248
248
            }
249
249
        }
250
250
    }
289
289
 
290
290
            if (!e->screenEdge)
291
291
            {
292
 
                it++;
 
292
                ++it;
293
293
                continue;
294
294
            }
295
295
 
330
330
            }
331
331
            else
332
332
            {
333
 
                it++;
 
333
                ++it;
334
334
            }
335
335
        }
336
336
    }