Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
String matching: Fix long strings prefix matching
Prefix matching is done by looking up the provided string in the LPM TRIE string prefix map (for strings and file paths). Currently, we don't look up strings that are longer than the prefix map can hold. This is a bug, because we could still look up the beginning substring (to the max the map allows) and if it matches, then the full string would also match (if the map size permitted it). This commit detects strings that are longer than the map allows and instead of not matching, it looks up the longest beginning substring that the map allows instead. This will allow prefix matching to be used on all strings and not just the ones short enough to fit into the prefix map. Signed-off-by: Kevin Sheldrake <[email protected]>
- Loading branch information