forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: "requestLockerItems" for improved safety and clarity (opent…
…ibiabr#2565) This introduces a refactoring of the requestLockerItems function to enhance its safety, prevent potential infinite loops, and improve code clarity. Key changes include: • Loop Structure: Replaced the original do-while loop with a safer for loop that ensures all accesses are within vector bounds. • Loop Removal: Eliminated the second do-while loop that manipulated countSize, which could lead to infinite loops and overflow issues. • Simplified Item Handling: Streamlined the handling of items from stashToSend, directly updating lockerItems without unnecessary intermediate steps. • General Cleanup: Improved overall readability and maintainability of the code, making it easier to understand and less prone to errors. These modifications ensure that the function behaves as intended while being more robust and easier to debug. Additionally, a small problem was fixed that prevented the server from shutting down. Resolves opentibiabr#2561
- Loading branch information
Showing
3 changed files
with
23 additions
and
36 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
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
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