08e1bba10c
Assigning within a conditional is confusing and error prone so I rewrote in a more straightforward way. Found with PVS-Studio T48917