From a944a9a902af0a45823c3a2c693880cedef90a3f Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 15 Apr 2010 11:33:14 +0000 Subject: [PATCH] Simplify ".bc" detection. llvm-svn: 101365 --- llvm/tools/lli/lli.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index affe6bb65314..4e3e07ffd22c 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -192,8 +192,7 @@ int main(int argc, char **argv, char * const *envp) { } else { // Otherwise, if there is a .bc suffix on the executable strip it off, it // might confuse the program. - if (InputFile.size() > 3 && - InputFile.rfind(".bc") == InputFile.length() - 3) + if (StringRef(InputFile).endswith(".bc")) InputFile.erase(InputFile.length() - 3); }