This revision was automatically updated to reflect the committed changes.
Closed by commit rL241390: Use string::find(char) for single character strings. 
(authored by brucem).

Changed prior to commit:
  http://reviews.llvm.org/D10943?vs=29045&id=29046#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D10943

Files:
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  lldb/trunk/tools/lldb-mi/MICmdArgValOptionShort.cpp
  lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
  lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
  lldb/trunk/tools/lldb-mi/MICmdFactory.cpp
  lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp

Index: lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
@@ -1750,17 +1750,17 @@
 
             // LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:3[:1]
             //              ^^^^^^^^^^^^^^^^^^ -- start address
-            const size_t nStartAddressStartPos = rLine.find("[");
-            const size_t nStartAddressEndPos = rLine.find("-");
+            const size_t nStartAddressStartPos = rLine.find('[');
+            const size_t nStartAddressEndPos = rLine.find('-');
             const size_t nStartAddressLen = nStartAddressEndPos - nStartAddressStartPos - 1;
             const CMIUtilString strStartAddress(rLine.substr(nStartAddressStartPos + 1, nStartAddressLen).c_str());
             const CMICmnMIValueConst miValueConst(strStartAddress);
             const CMICmnMIValueResult miValueResult("start", miValueConst);
             CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
 
             // LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:3[:1]
             //                                 ^^^^^^^^^^^^^^^^^^ -- end address
-            const size_t nEndAddressEndPos = rLine.find(")");
+            const size_t nEndAddressEndPos = rLine.find(')');
             const size_t nEndAddressLen = nEndAddressEndPos - nStartAddressEndPos - 1;
             const CMIUtilString strEndAddress(rLine.substr(nStartAddressEndPos + 1, nEndAddressLen).c_str());
             const CMICmnMIValueConst miValueConst2(strEndAddress);
Index: lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
@@ -231,11 +231,11 @@
         return false;
 
     // Look for -f type short options, if found reject
-    if ((0 == vrTxt.find("-")) && (vrTxt.length() == 2))
+    if ((0 == vrTxt.find('-')) && (vrTxt.length() == 2))
         return false;
 
     // Look for thread group i1 i2 i3...., if found reject
-    if ((vrTxt.find("i") == 0) && ::isdigit(vrTxt[1]))
+    if ((vrTxt.find('i') == 0) && ::isdigit(vrTxt[1]))
         return false;
 
     // Look for numbers, if found reject
Index: lldb/trunk/tools/lldb-mi/MICmdFactory.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdFactory.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdFactory.cpp
@@ -159,7 +159,7 @@
         return false;
     }
 
-    const size_t nPos = vMiCmd.find(" ");
+    const size_t nPos = vMiCmd.find(' ');
     if (nPos != std::string::npos)
         bValid = false;
 
Index: lldb/trunk/tools/lldb-mi/MICmdArgValOptionShort.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdArgValOptionShort.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdArgValOptionShort.cpp
@@ -80,7 +80,7 @@
         return false;
 
     // Look for -f short option
-    nPos = vrTxt.find("-");
+    nPos = vrTxt.find('-');
     if (nPos != 0)
         return false;
 
Index: lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp
===================================================================
--- lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp
+++ lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp
@@ -153,7 +153,7 @@
 CMICmdInterpreter::MiHasCmdTokenEndingHyphen(const CMIUtilString &vTextLine)
 {
     // The hyphen is mandatory
-    const size_t nPos = vTextLine.find("-", 0);
+    const size_t nPos = vTextLine.find('-', 0);
     if ((nPos == std::string::npos))
         return false;
 
@@ -215,7 +215,7 @@
 bool
 CMICmdInterpreter::MiHasCmdTokenPresent(const CMIUtilString &vTextLine)
 {
-    const size_t nPos = vTextLine.find("-", 0);
+    const size_t nPos = vTextLine.find('-', 0);
     return (nPos > 0);
 }
 
@@ -246,12 +246,12 @@
     }
     else
     {
-        nPos = vTextLine.find("-", 0);
+        nPos = vTextLine.find('-', 0);
     }
 
     bool bFoundCmd = false;
     const size_t nLen = vTextLine.length();
-    const size_t nPos2 = vTextLine.find(" ", nPos);
+    const size_t nPos2 = vTextLine.find(' ', nPos);
     if (nPos2 != std::string::npos)
     {
         if (nPos2 == nLen)
Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1558,7 +1558,7 @@
 std::string
 ObjectFileELF::StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const
 {
-    size_t pos = symbol_name.find("@");
+    size_t pos = symbol_name.find('@');
     return symbol_name.substr(0, pos).str();
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to