On Wed Nov 22 18:59:22 2023 +0000, Francisco Casas wrote:
changed this line in [version 2 of the diff](/wine/vkd3d/-/merge_requests/487/diffs?diff_id=85230&start_sha=ccc8dd58d1e3c4aa4f8b31a64fe259cc25130c52#3cf804f245af47d51595ff932bf817c50967eea2_1356_1365)
The idea is to, assuming that the records are sorted from oldest to newest, find the oldest record that happened before `time`, i.e. the record that was in effect at a given time, or indicate when there isn't any (this is the `r == -1` case).
My understanding is that the for-if anti-pattern is when the iteration is not necessary, and I think it is in this case. Albeit, I can make it more readable at the expense of making it more verbose, I added copy_propagation_get_value_at_time().
Also... holy moly! That `break` in ``` if (!value) break; ``` should have been a `continue` instead. In the current code it is a `break` but because it is inside a `switch` statement. Surprising that no test broke with this mistake, I fixed it.