Change calculation way

Put ? operator instead of if. it got 2000000 more nodes in bench
command.

No functional change.