Skip to content

Correct lookup with shared key and glob#30

Merged
luislavena merged 1 commit intomasterfrom
fix/partial-shared-key-glob
Jan 31, 2021
Merged

Correct lookup with shared key and glob#30
luislavena merged 1 commit intomasterfrom
fix/partial-shared-key-glob

Conversation

@luislavena
Copy link
Owner

Properly skip nodes and continue lookup when the key to be looked up shares partial elements with others.

With the following scenario:

tree = Radix::Tree(Symbol).new
tree.add "/*glob", :catch_all
tree.add "/resources", :resources
tree.add "/robots.txt", :robots

When attempt to lookup for /reviews, it will now correctly return :catch_all as found.

Fixes #23

Properly skip nodes and continue lookup when the key to be looked up
shares partial elements with others.

With the following scenario:

  tree = Radix::Tree(Symbol).new
  tree.add "/*glob", :catch_all
  tree.add "/resources", :resources
  tree.add "/robots.txt", :robots

When attempt to lookup for `/reviews`, it will now correctly return
`:catch_all` as found.

Fixes #23
@luislavena luislavena merged commit f8df18b into master Jan 31, 2021
@luislavena luislavena deleted the fix/partial-shared-key-glob branch January 31, 2021 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wildcard lookup issue with previously defined deep paths...

1 participant