mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:50:17 +08:00
[lldb][NFC] Address review comments to StringList for-loop support
llvm-svn: 369237
This commit is contained in:
@@ -23,7 +23,7 @@ class Stream;
|
||||
namespace lldb_private {
|
||||
|
||||
class StringList {
|
||||
typedef std::vector<std::string> StorageType;
|
||||
typedef std::vector<std::string> collection;
|
||||
|
||||
public:
|
||||
StringList();
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
|
||||
size_t GetMaxStringLength() const;
|
||||
|
||||
typedef StorageType::iterator iterator;
|
||||
typedef StorageType::const_iterator const_iterator;
|
||||
typedef collection::iterator iterator;
|
||||
typedef collection::const_iterator const_iterator;
|
||||
|
||||
iterator begin() { return m_strings.begin(); }
|
||||
iterator end() { return m_strings.end(); }
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
StorageType m_strings;
|
||||
collection m_strings;
|
||||
};
|
||||
|
||||
} // namespace lldb_private
|
||||
|
||||
@@ -436,10 +436,9 @@ protected:
|
||||
Status error;
|
||||
|
||||
for (const std::string &type_name : options->m_target_types) {
|
||||
ConstString const_type_name(type_name);
|
||||
if (const_type_name) {
|
||||
if (!type_name.empty()) {
|
||||
if (!CommandObjectTypeSynthAdd::AddSynth(
|
||||
const_type_name, synth_provider,
|
||||
ConstString(type_name), synth_provider,
|
||||
options->m_regex
|
||||
? CommandObjectTypeSynthAdd::eRegexSynth
|
||||
: CommandObjectTypeSynthAdd::eRegularSynth,
|
||||
|
||||
@@ -61,6 +61,7 @@ void StringList::AppendList(const char **strv, int strc) {
|
||||
}
|
||||
|
||||
void StringList::AppendList(StringList strings) {
|
||||
m_strings.reserve(m_strings.size() + strings.GetSize());
|
||||
m_strings.insert(m_strings.end(), strings.begin(), strings.end());
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ TEST(StringListTest, ForRangeEmpty) {
|
||||
FAIL() << "Shouldn't have hit an element in for range" << e;
|
||||
}
|
||||
|
||||
TEST(StringListTest, ForRangeSingle) {
|
||||
TEST(StringListTest, ForRange) {
|
||||
StringList s;
|
||||
s.AppendString("a");
|
||||
s.AppendString("b");
|
||||
|
||||
Reference in New Issue
Block a user