Rewrite the logic for handling multiple partitions in clogs scan
Rewrite the logic for handling multiple partitions in clogs scan

This should be more correct (and more obviously correct) in the face of
zero-sized partitions.

Poulpy21/vexcl,kapadia/vexcl,Poulpy21/vexcl,ddemidov/vexcl,ddemidov/vexcl,Poulpy21/vexcl,kapadia/vexcl