]> granicus.if.org Git - clang/commitdiff
Avoid trashing two temporary strings.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 5 Dec 2009 10:22:15 +0000 (10:22 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 5 Dec 2009 10:22:15 +0000 (10:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90663 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCodeComplete.cpp

index 18b6be099f465e07831741445613f8e8878f9932..7d71cd723f9babe3afaafcf7ac8f194046ed94d6 100644 (file)
@@ -1110,8 +1110,8 @@ namespace {
       // The only stable ordering we have is to turn the name into a
       // string and then compare the lower-case strings. This is
       // inefficient, but thankfully does not happen too often.
-      return llvm::LowercaseString(X.getAsString()) 
-        < llvm::LowercaseString(Y.getAsString());
+      return llvm::StringRef(X.getAsString()).compare_lower(
+                                                 Y.getAsString()) < 0;
     }
     
     bool operator()(const Result &X, const Result &Y) const {