~compiz-team/compiz/compiz.fix_1088399

« back to all changes in this revision

Viewing changes to plugins/expo/src/expo.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:
678
678
    GLMatrix sTransform (transform);
679
679
    float    p1[3], p2[3], v[3], alpha;
680
680
    GLint    viewport[4];
681
 
    int      i;
682
681
 
683
682
    gScreen->glApplyTransform (attrib, output, &sTransform);
684
683
    sTransform.toScreenSpace (output, -attrib.zTranslate);
692
691
               sTransform, *gScreen->projectionMatrix (), viewport,
693
692
               &p2[0], &p2[1], &p2[2]);
694
693
 
695
 
    for (i = 0; i < 3; i++)
 
694
    for (int i = 0; i < 3; i++)
696
695
        v[i] = p1[i] - p2[i];
697
696
 
698
697
    alpha = -p1[2] / v[2];