mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The PropertyMap wants to use a try to map to PropertyBags, and it needs longest-suffix rather than shortest-prefix matching. Implement both by making Trie into a template class with two parameters; the ValueType, and the MatchKind. Note that while the MatchKind encodes the longest vs shortest match part, matching on the prefix vs suffix of a term is up to the caller, since the find() and insert() methods of Trie take a pair of iterators, so simply passing in begin()/end() vs rbegin()/rend() selects the direction.
7.6 KiB
7.6 KiB