diff options
| author | hjk <hjk@qt.io> | 2018-09-25 18:48:29 +0200 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2018-09-26 06:15:41 +0000 |
| commit | 4b42789bdaccb89441ebd0b85fe7ab7fdea04df5 (patch) | |
| tree | c0f90edf71ab633668779b457e345382f43719fc /src/plugins/debugger/debuggerprotocol.cpp | |
| parent | e0dcb645cdc3a2a006e67b0d1f04bd704540cb53 (diff) | |
| download | qt-creator-4b42789bdaccb89441ebd0b85fe7ab7fdea04df5.tar.gz | |
Debugger: Privatize GdbMi::m_children
Change-Id: I6e51290c4521be40f516a452f32bdc82a4c051e6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/debuggerprotocol.cpp')
| -rw-r--r-- | src/plugins/debugger/debuggerprotocol.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index b74770afa8..c414e08909 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -267,15 +267,19 @@ static QString ind(int indent) void GdbMi::dumpChildren(QString * str, bool multiline, int indent) const { - for (int i = 0; i < m_children.size(); ++i) { - if (i != 0) { + bool first = true; + for (const GdbMi &child : *this) { + if (first) { + first = false; + } else { *str += ','; if (multiline) *str += '\n'; } + if (multiline) *str += ind(indent); - *str += m_children.at(i).toString(multiline, indent); + *str += child.toString(multiline, indent); } } @@ -371,9 +375,9 @@ void GdbMi::fromStringMultiple(const QString &ba) const GdbMi &GdbMi::operator[](const char *name) const { static GdbMi empty; - for (int i = 0, n = int(m_children.size()); i < n; ++i) - if (m_children.at(i).m_name == QLatin1String(name)) - return m_children.at(i); + for (const GdbMi &child : *this) + if (child.m_name == QLatin1String(name)) + return child; return empty; } |
