[cfe-commits] PATCH: Add support for C++ namespace-aware typo correcting

Chandler Carruth chandlerc at google.com
Thu Jun 9 18:34:25 PDT 2011


On Thu, Jun 9, 2011 at 6:18 PM, Kaelyn Uhrain <rikka at google.com> wrote:

> Quick question about doing this: would it be more cost effective to use a
> std::multimap to allow iterating through the namespaces in ascending order
> of NNS length and exiting the loop once NNS length + edit distance are worse
> than the best, or to use an llvm::SmallVector instead and always looping
> over all of the namespaces, but skipping the lookup if (NNS length + ED) is
> too long?


Iterating over a std::map or std::multimap is rather slow. Why can't we just
keep the SmallVector sorted by the NNS length?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110609/95a9d109/attachment.html>


More information about the cfe-commits mailing list