diff options
| author | Ilia K <ki.stfu@gmail.com> | 2015-09-25 08:28:58 +0000 |
|---|---|---|
| committer | Ilia K <ki.stfu@gmail.com> | 2015-09-25 08:28:58 +0000 |
| commit | b2b0170c0e1bc25498477d76975a3a671ab87c11 (patch) | |
| tree | 3e519d3ffdbcffcf6cca7cd6e10255e757e3d99e /lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp | |
| parent | f69d45efc3c119c53cd725b422d88fe7edcfdb10 (diff) | |
| download | bcm5719-llvm-b2b0170c0e1bc25498477d76975a3a671ab87c11.tar.gz bcm5719-llvm-b2b0170c0e1bc25498477d76975a3a671ab87c11.zip | |
Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI)
Summary:
Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI)
This patch cleans up lldb-mi code, and serves to simplify
the following case:
```
std::string strGoodbye = "!Hello";
CMIUtilString strHello(strGoodbye.substr(1).c_str());
```
With CMIUtilString(std::string) we can omit .c_str():
```
std::string strGoodbye = "!Hello";
CMIUtilString strHello(strGoodbye.substr(1));
```
Also, it removes 2 ctors because they aren't needed:
# CMIUtilString::CMIUtilString(const char *const *vpData)
# CMIUtilString::CMIUtilString(const char *vpData, size_t nLen)
and cleans up CMIUtilString::operator=(const std::string &vrRhs).
Reviewers: brucem, abidh
Subscribers: lldb-commits, brucem, abidh
Differential Revision: http://reviews.llvm.org/D13158
llvm-svn: 248566
Diffstat (limited to 'lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp')
| -rw-r--r-- | lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp b/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp index 6b79fc84ee9..43e9c724dca 100644 --- a/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp +++ b/lldb/tools/lldb-mi/MICmdArgValThreadGrp.cpp @@ -121,7 +121,7 @@ CMICmdArgValThreadGrp::IsArgThreadGrp(const CMIUtilString &vrTxt) const if (nPos != 0) return false; - const CMIUtilString strNum = vrTxt.substr(1).c_str(); + const CMIUtilString strNum = vrTxt.substr(1); if (!strNum.IsNumber()) return false; @@ -139,7 +139,7 @@ CMICmdArgValThreadGrp::IsArgThreadGrp(const CMIUtilString &vrTxt) const bool CMICmdArgValThreadGrp::ExtractNumber(const CMIUtilString &vrTxt) { - const CMIUtilString strNum = vrTxt.substr(1).c_str(); + const CMIUtilString strNum = vrTxt.substr(1); MIint64 nNumber = 0; bool bOk = strNum.ExtractNumber(nNumber); if (bOk) |

