luislavena / radix

Radix Tree implementation for Crystal
MIT License
102 stars 14 forks source link

Correctly build key from detected parameters #3

Closed luislavena closed 8 years ago

luislavena commented 8 years ago

Given a key /:foo/:bar, the find mechanism was incorrectly picking the separator character as part of the key name (foo/).

This caused incorrect match between expected name (foo) and the one obtained.

When the key name was extracted from the named parameter, the size of the returned key was not compensated, given that we move +1 positions to avoid having ':' as part of the key.

This is now corrected by reducing the key size one shorter to compensate.

Fixes Issue #2