From: Rui Ueyama Date: Thu, 31 Oct 2013 19:12:53 +0000 (+0000) Subject: Use StringRef::endswith_lower. No functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=723ceadd234bc55964c5981c9de5e4cd29bd7902;p=clang Use StringRef::endswith_lower. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193788 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 0d5c47686f..7d7f7b7dda 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -1307,10 +1307,8 @@ static std::string qualifyWindowsLibrary(llvm::StringRef Lib) { // If the argument does not end in .lib, automatically add the suffix. This // matches the behavior of MSVC. std::string ArgStr = Lib; - if (Lib.size() <= 4 || - Lib.substr(Lib.size() - 4).compare_lower(".lib") != 0) { + if (!Lib.endswith_lower(".lib")) ArgStr += ".lib"; - } return ArgStr; }