buffet: remove unnecessary NOLINTs and restored some C++11 code
The old cpplint was issuing a lot of false-positives for new C++11
features and I had to either explicitly disable the warning or
work around them (e.g. instead of using uniform initialization,
I used a normal constructor syntax with initializer list inside).
These redundancies are no longer needed since the linter has been
updated.
Also removed some of auto&& from loops because the new
cpplint complains about RValue references.
BUG=None
TEST=Unit tests still pass.
Change-Id: Ibe9538e3e1cb793be807a23e82627444e663934c
Reviewed-on: https://chromium-review.googlesource.com/203797
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/buffet_client.cc b/buffet/buffet_client.cc
index a763e42..11f4ffc 100644
--- a/buffet/buffet_client.cc
+++ b/buffet/buffet_client.cc
@@ -136,7 +136,7 @@
if (!args.empty()) {
auto key_values = buffet::data_encoding::WebParamsDecode(args.front());
- for (auto&& pair : key_values) {
+ for (const auto& pair : key_values) {
params.insert(std::make_pair(
pair.first, std::shared_ptr<base::Value>(
base::Value::CreateStringValue(pair.second))));
@@ -148,7 +148,7 @@
dbus::MessageWriter writer(&method_call);
dbus::MessageWriter dict_writer(nullptr);
writer.OpenArray("{sv}", &dict_writer);
- for (auto&& pair : params) {
+ for (const auto& pair : params) {
dbus::MessageWriter dict_entry_writer(nullptr);
dict_writer.OpenDictEntry(&dict_entry_writer);
dict_entry_writer.AppendString(pair.first);
@@ -252,8 +252,8 @@
private:
scoped_refptr<dbus::Bus> bus_;
- dbus::ObjectProxy* manager_proxy_{nullptr}; // NOLINT - initializer list
- dbus::ObjectProxy* root_proxy_{nullptr}; // NOLINT - initializer list
+ dbus::ObjectProxy* manager_proxy_{nullptr};
+ dbus::ObjectProxy* root_proxy_{nullptr};
};
} // namespace