robfig/pathtree — pull request #4 by pushrax (2014-01-19 04:02:47+00:00)
Title: Allow single element wildcards in the last path segment to end with an extension

Fixes https://github.com/robfig/revel/issues/333 and https://github.com/robfig/revel/issues/459

The implementation feels a bit ugly to me, since it's not clear that it's keeping the extension in the last wildcard element and then trimming it out later. @robfig you may already have a better way in mind.

Efficiency delta is negligible:

| Test | master | new |
| :------------- |-------------| -----|
| BenchmarkTree100 | 809 ns/op | 813 ns/op |
| BenchmarkRouter | 1789 ns/op | 1793 ns/op |
| BenchmarkLargeRouter | 1340 ns/op | 1336 ns/op |
| BenchmarkRouterFilter | 3138 ns/op | 3143 ns/op |

(including the router benchmarks from the revel test suite)

cc @brendensoares as you're not currently watching this repo.