~compiz-team/compiz/compiz.fix_1088399

« back to all changes in this revision

Viewing changes to kde/window-decorator-kde4/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:
1570
1570
 
1571
1571
    if (status)
1572
1572
    {
1573
 
        int i;
1574
 
 
1575
 
        for (i = 0; i < n; i++)
 
1573
        for (int i = 0; i < n; i++)
1576
1574
        {
1577
1575
            if (p[i] == Atoms::wmTakeFocus)
1578
1576
                mSupportTakeFocus = true;
1627
1625
    {
1628
1626
        NETRootInfo *rootInfo = Decorator::rootInfo ();
1629
1627
        QString     name;
1630
 
        int         i;
1631
1628
        int         winDesktop = desktop ();
1632
1629
        QAction     *action;
1633
1630
        const int   BASE = 10;
1642
1639
        action->setChecked (winDesktop == NET::OnAllDesktops);
1643
1640
        mDesktopMenu->addSeparator ();
1644
1641
 
1645
 
        for (i = 1; i <= numberOfDesktops; i++)
 
1642
        for (int i = 1; i <= numberOfDesktops; i++)
1646
1643
        {
1647
1644
            QString basic_name ("%1 %2");
1648
1645
            if (i < BASE)