summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmdArgValFile.cpp
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2015-09-01 23:57:17 +0000
committerBruce Mitchener <bruce.mitchener@gmail.com>2015-09-01 23:57:17 +0000
commite8433cc17941d760f8ec96c6f280e152e4f00ef0 (patch)
tree7a788e52e18bfb377bacbe2cf4660c98cf6486e4 /lldb/tools/lldb-mi/MICmdArgValFile.cpp
parent11deaae8a132906a0acdfa0d5801c5dd1b557b81 (diff)
downloadbcm5719-llvm-e8433cc17941d760f8ec96c6f280e152e4f00ef0.tar.gz
bcm5719-llvm-e8433cc17941d760f8ec96c6f280e152e4f00ef0.zip
Simplify find_first_of & find_last_of on single char.
Summary: When calling find_first_of and find_last_of on a single character, we can instead just call find / rfind and make our intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12518 llvm-svn: 246609
Diffstat (limited to 'lldb/tools/lldb-mi/MICmdArgValFile.cpp')
-rw-r--r--lldb/tools/lldb-mi/MICmdArgValFile.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/tools/lldb-mi/MICmdArgValFile.cpp b/lldb/tools/lldb-mi/MICmdArgValFile.cpp
index 9e59dec1d02..7f5b20ec314 100644
--- a/lldb/tools/lldb-mi/MICmdArgValFile.cpp
+++ b/lldb/tools/lldb-mi/MICmdArgValFile.cpp
@@ -142,8 +142,8 @@ CMICmdArgValFile::IsFilePath(const CMIUtilString &vrFileNamePath) const
if (vrFileNamePath.empty())
return false;
- const bool bHavePosSlash = (vrFileNamePath.find_first_of("/") != std::string::npos);
- const bool bHaveBckSlash = (vrFileNamePath.find_first_of("\\") != std::string::npos);
+ const bool bHavePosSlash = (vrFileNamePath.find('/') != std::string::npos);
+ const bool bHaveBckSlash = (vrFileNamePath.find('\\') != std::string::npos);
// Look for --someLongOption
size_t nPos = vrFileNamePath.find("--");
@@ -152,13 +152,13 @@ CMICmdArgValFile::IsFilePath(const CMIUtilString &vrFileNamePath) const
return false;
// Look for -f type short parameters
- nPos = vrFileNamePath.find_first_of("-");
+ nPos = vrFileNamePath.find('-');
const bool bShort = (nPos == 0);
if (bShort)
return false;
// Look for i1 i2 i3....
- nPos = vrFileNamePath.find_first_of("i");
+ nPos = vrFileNamePath.find('i');
const bool bFoundI1 = ((nPos == 0) && (::isdigit(vrFileNamePath[1])));
if (bFoundI1)
return false;
OpenPOWER on IntegriCloud