Fix readability of TTEntry occupancy check #5394
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I say "fix" due #5263. That discussion was lengthy, and at least one comment appeared to not know what this code did. I wonder if it would have been submitted (or accepted) if that patch had read more like this one.
Also, setting aside the old PR, this is a clear readability gain anyways. Beginners can't understand it all, intermediates need to think a while to recall it, and even experts need a couple seconds per read to work out if it's an occupancy check or a genuine depth computation.
I think it just makes the code clearly easier to read and maintain.
Passed STC non-reg: https://tests.stockfishchess.org/tests/view/66695b6a602682471b064cfc
LLR: 2.93 (-2.94,2.94) <-1.75,0.25>
Total: 107520 W: 28138 L: 27998 D: 51384
Ptnml(0-2): 373, 12257, 28358, 12401, 371
no functional change