Optimization try for castle check

in bench command:
condition checked 70766 times,
and was true in 67302 times.
So it is effective in 95% of the times.
move condition to as earlier as possible