diff --git a/src/radix/tree.cr b/src/radix/tree.cr index c477999..cc6d2a2 100644 --- a/src/radix/tree.cr +++ b/src/radix/tree.cr @@ -147,7 +147,11 @@ module Radix node.children.each do |child| # compare first character next unless child.key[0]? == new_key[0]? - next if new_key[0] == ':' + if child.key[0] == ':' && new_key[0] == ':' + new_key_param = extract_key(Char::Reader.new(new_key)) + next if child.key != new_key_param + new_key = new_key[new_key.index('/') as Int32..-1] + end # when found, add to this child added = true