[Routing] use strncmp() instead of strpos()

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | no
| License       | MIT
| Doc PR        | no

strncmp() is faster than strpos() as it stops scanning the string at the very first non-match.