refactor update_piece_threats to reduce branching
Passed STC Non-Regression:
https://tests.stockfishchess.org/tests/view/696f1a398b64097dacd231c3
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 122272 W: 31587 L: 31466 D: 59219
Ptnml(0-2): 301, 13358, 33750, 13373, 354
slight speedup as well:
1 thread bench:
sf_base = 2238429 +/- 1221 (95%)
sf_test = 2248298 +/- 1371 (95%)
diff = 9869 +/- 1571 (95%)
speedup = 0.44090% +/- 0.070% (95%)
32 thread speedtest:
sf_base = 41016996 +/- 83654 (95%)
sf_test = 41185801 +/- 84269 (95%)
diff = 168805 +/- 79986 (95%)
speedup = 0.41155% +/- 0.195% (95%)
closes https://github.com/official-stockfish/Stockfish/pull/6559
No functional change