forked from irungentoo/toxcore
-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Make prune_gc_sanctions_list more obviously correct.
`target_ext_pk` is uninitialised before the loop, and is definitely initialised after the loop *iff* `sanction` isn't NULL. If it is NULL, then `target_ext_pk` is not read. This is verifiable, but not obvious. PVS Studio isn't smart enough to figure that out, so it complains. I consider it a valid complaint, and the new code is clearer: we now call the processing part of the function directly with initialised values instead of relying on that initialisation coinciding with `sanction`s nullity.
- Loading branch information
Showing
1 changed file
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters