~vanvugt/compiz/fix-1026920

« back to all changes in this revision

Viewing changes to plugins/composite/src/window.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:
454
454
                                          int             width,
455
455
                                          int             height)
456
456
{
 
457
    if (!w->priv->redirected)
 
458
        return;
 
459
 
457
460
    bool   initial = false;
458
461
 
459
 
    if (!w->priv->redirected)
460
 
        return;
461
 
 
462
462
    if (!w->priv->damaged)
463
463
    {
464
464
        w->priv->damaged = initial = true;
481
481
void
482
482
CompositeWindow::updateOpacity ()
483
483
{
484
 
    unsigned short opacity;
485
 
 
486
484
    if (priv->window->type () & CompWindowTypeDesktopMask)
487
485
        return;
488
486
 
489
 
    opacity = screen->getWindowProp32 (priv->window->id (),
 
487
    unsigned short opacity = screen->getWindowProp32 (priv->window->id (),
490
488
                                             Atoms::winOpacity, OPAQUE);
491
489
 
492
490
    if (opacity != priv->opacity)