~compiz-team/compiz/compiz.fix_1088399

« back to all changes in this revision

Viewing changes to plugins/obs/src/obs.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:
197
197
void
198
198
ObsScreen::matchPropertyChanged (CompWindow  *w)
199
199
{
200
 
    unsigned int i;
201
 
 
202
 
    for (i = 0; i < MODIFIER_COUNT; i++)
 
200
    for (unsigned int i = 0; i < MODIFIER_COUNT; i++)
203
201
        ObsWindow::get (w)->updatePaintModifier (i);
204
202
 
205
203
    screen->matchPropertyChanged (w);
249
247
bool
250
248
ObsWindow::updateTimeout ()
251
249
{
252
 
    int i;
253
 
    
254
 
    for (i = 0; i < MODIFIER_COUNT; i++)
 
250
    for (int i = 0; i < MODIFIER_COUNT; i++)
255
251
        updatePaintModifier (i);
256
252
 
257
253
    return false;
262
258
                      CompOption::Value &value)
263
259
{
264
260
    CompOption   *o;
265
 
    unsigned int i;
266
261
 
267
262
    if (!ObsOptions::setOption (name, value))
268
263
        return false;
271
266
    if (!o)
272
267
        return false;
273
268
 
274
 
    for (i = 0; i < MODIFIER_COUNT; i++)
 
269
    for (unsigned int i = 0; i < MODIFIER_COUNT; i++)
275
270
    {
276
271
        if (o == matchOptions[i] || o == valueOptions[i])
277
272
        {