-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow calling Delete() inside Walk() and WalkPrefix()
In recursiveWalk called by Walk and WalkPrefix, we were iterating over the edges of a node. The edges as well as the current node object itself (when mergeChild is called) can be modified by calls to Delete. This commit modifies the loop to handle modifications correctly and prevent a nil pointer dereference panic in the case detailed in TestWalkDelete. Signed-off-by: Tibor Vass <teabee89@gmail.com>
- Loading branch information
Showing
2 changed files
with
52 additions
and
1 deletion.
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