-
Notifications
You must be signed in to change notification settings - Fork 872
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor recursive functions to iterative to prevent stack overflow
Convert `_match_prefix_helper`, `_insert_helper`, `_print_helper`, and `_total_size_helper` from recursive to iterative implementations using stacks or loop. This prevents potential stack overflow errors with deep trees while maintaining the same functionality. Also update the test cases to use tensor values instead of strings for better testing of the radix cache's core functionality.
- Loading branch information
1 parent
6c856b4
commit d02f0d0
Showing
1 changed file
with
70 additions
and
53 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