Skip to content

Fix incorrect lookup in non-root nodes#31

Merged
luislavena merged 1 commit intomasterfrom
fix/non-root-lookup
Jan 31, 2021
Merged

Fix incorrect lookup in non-root nodes#31
luislavena merged 1 commit intomasterfrom
fix/non-root-lookup

Conversation

@luislavena
Copy link
Owner

Given the following non-root tree:

tree = Tree(Symbol).new
tree.add "/prefix/", :prefix
tree.add "/prefix/foo", :foo

Attempt to lookup for /foo was incorrectly identifying :foo entry as the correct value.

This change ensures that child nodes of the current node are not scanned if key and path being looked up do not match.

Fixes #27

Given the following non-root tree:

  tree = Tree(Symbol).new
  tree.add "/prefix/", :prefix
  tree.add "/prefix/foo", :foo

Attempt to lookup for `/foo` was incorrectly identifying `:foo` entry as
the correct value.

This change ensures that child nodes of the current node are not scanned
if key and path being looked up do not match.

Fixes #27
@luislavena luislavena merged commit c6a0701 into master Jan 31, 2021
@luislavena luislavena deleted the fix/non-root-lookup branch January 31, 2021 02:37
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.

Unexpected suffix match

1 participant