From 3bb37e968bcb202abba0c359c178817fc97ab6e8 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 15 Apr 2010 11:33:14 +0000 Subject: [PATCH] Simplify ".bc" detection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101365 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/lli/lli.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index affe6bb6531..4e3e07ffd22 100644 --- a/tools/lli/lli.cpp +++ b/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); } -- 2.34.1