File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class PluginRegistry
69
69
{
70
70
public:
71
71
static PluginRegistry& Instance() { return instance; }
72
- void Register(const string& name, Factory factory) { plugins.push_back(make_pair( name, factory) ); }
72
+ void Register(const string& name, Factory factory) { plugins.emplace_back( name, factory); }
73
73
void Print(ostream& out) const
74
74
{
75
75
for (auto& p: plugins)
@@ -140,7 +140,7 @@ class RegisteredPlugin : public Plugin
140
140
RegisteredPlugin() : Plugin(NAME)
141
141
{
142
142
const Registration& dummy = registration;
143
- do { (void)(dummy); } while (0 ); // silence unused variable warning
143
+ do { (void)(dummy); } while (false ); // silence unused variable warning
144
144
}
145
145
private:
146
146
static unique_ptr<Plugin> Create(Menu* menu) { return make_unique<T>(menu); }
Original file line number Diff line number Diff line change @@ -98,12 +98,12 @@ class Text
98
98
// Should come back into the word state after this.
99
99
prev_state = State::word;
100
100
state = State::escape;
101
- splitResult.push_back ("");
101
+ splitResult.emplace_back ("");
102
102
}
103
103
else
104
104
{
105
105
state = State::word;
106
- splitResult.push_back(std::string( 1, c) );
106
+ splitResult.emplace_back( 1, c);
107
107
}
108
108
}
109
109
@@ -167,7 +167,7 @@ class Text
167
167
{
168
168
state = State::sentence;
169
169
sentence_type = ( c == '"' ? SentenceType::double_quote : SentenceType::quote);
170
- splitResult.push_back ("");
170
+ splitResult.emplace_back ("");
171
171
}
172
172
173
173
void RemoveEmptyEntries()
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ BOOST_AUTO_TEST_CASE(SingleQuotedCases)
140
140
BOOST_CHECK_EQUAL(strs[0], "first");
141
141
BOOST_CHECK_EQUAL(strs[1], "foo \tbar");
142
142
143
- split(strs, " first '\ "second\" \ "thirdh\"' "); // first '"second" "thirdh"'
143
+ split(strs, R"( first '"second" "thirdh"') "); // first '"second" "thirdh"'
144
144
BOOST_CHECK_EQUAL(strs.size(), 2);
145
145
BOOST_CHECK_EQUAL(strs[0], "first");
146
146
BOOST_CHECK_EQUAL(strs[1], "\"second\" \"thirdh\"");
You can’t perform that action at this time.
0 commit comments