-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor radix cache helper functions to use iterative approaches
Replace recursive implementations with iterative ones using stacks in `_match_prefix_helper`, `_print_helper`, and `_total_size_helper` to prevent potential stack overflow issues. Simplify the return value handling in `_match_prefix_helper` by removing the list parameter and returning a tuple directly. Streamline the `_insert_helper` logic with a while loop for better readability and maintainability. These changes improve performance and reliability while maintaining the same functionality.
- Loading branch information
1 parent
4885b90
commit 4447c79
Showing
1 changed file
with
45 additions
and
35 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