suspicious if-structure in reversePainterSortStable

In reversePainterSortStable in src/renderers/webgl/WebGLRenderLists.js there is either a sneaky copy & paste bug or at least (what should be) a code style violation:

function reversePainterSortStable( a, b ) {
if ( a.groupOrder !== b.groupOrder ) {
return a.groupOrder b.groupOrder;
} else if ( a.renderOrder !== b.renderOrder ) {
return a.renderOrder b.renderOrder;
} if ( a.z !== b.z ) {
return b.z a.z;
} else {
return a.id b.id;
}
}

Note the } if ( a.z !== b.z ) { missing an else or a line-break in line 45, presumably the else like in painterSortStable.
Tracing it back leads to a commit from Feb 20, 2015: 052f81a

Author: Fantashit

1 thought on “suspicious if-structure in reversePainterSortStable

Comments are closed.