Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perfect: Refactor deinitializeIfNeeded for Performance and Safety
This commit adjusts the deinitializeIfNeeded method in MalomSolutionAccess to enhance performance and ensure safety. The check for a null pointer (pp == nullptr) is moved to the beginning of the method. This change prevents unnecessary cleanup calls and potential double deletion issues, improving both the performance and robustness of the code. By returning early when pp is null, we avoid redundant cleanup operations and align with the intended idempotent nature of the function. Reference: ggevay/malom#3 (comment) Change-Id: I6b77af22f99ad500217f1a70145144b33c1f20fb
- Loading branch information