-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lowers named and glob node priority to fix lookup issue
Given two similar keys, one short and one with named parameter, lookup was incorretly picking up the named parameter version instead of the specific one: tree = Radix::Tree(Symbol).new tree.add "/tag-edit/:id", :edit_tag tree.add "/tag-edit2", :alternate_edit_tag result = tree.find("/tag-edit2") result.found? # => false The order of insertion (named before specific) was causing the lookup mechanism to validate it before checking the other options. With the changes present here, short or long keys will be affected anymore by named or globbed keys present when sharing part of the key. Fixes kemalcr/kemal#293
- Loading branch information
1 parent
40b8e26
commit 5a6811e
Showing
4 changed files
with
40 additions
and
15 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
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