I'm sorry Klaus, but why do you want to omit the extra 'for' loop?
I think, that you want to omit it for performance reasons.
Not really - I'd just like to avoid it ;-)
But is it really
better to perform many overlap detections in the inner loop to finally realize
in the last run of the outer loop, that the last area has a wrong alignment?
Well, in case everything is ok (which is the normal case during production
operation) it will have to run through both loops completely, anyway.
The only case where it wouldn't run through all loops cmpletely is in case
of an error - and that's something the programmer will have to fix, anayway.