View Single Post
Old 20 December 2019, 15:22   #17
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,048
Code:
/*if (topLeft) {
                    reverse = FALSE;
                    fci = FALSE;
                } else {
                    reverse = TRUE;
                    fci = TRUE;
                }*/
fci = reverse = !topleft;

/*                if (topRight) {
                    reverse = FALSE;
                    fci = TRUE;
                } else {
                    reverse = TRUE;
                    fci = FALSE;
                }*/
reverse = !(fci = topright);

/*            if (bottomRight) {
                reverse = TRUE;
                fci = TRUE;
            } else {
                reverse = FALSE;
                fci = FALSE;
            }*/
fci = reverse = bottomRight;

etc...
Yeah, it's the same code, but 8*6 lines shorter. It's 'easier' to map directly to Scc in asm (I'm sure the produced code is the same, but it's about the idea/hint to give to compiler how to optimize w/o using branches).
And I don't find it any harder to understand, but that's subjective.
a/b is offline  
 
Page generated in 0.04410 seconds with 11 queries