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/map_utils.h b/buffet/map_utils.h
index 87d8d37..f5e3f30 100644
--- a/buffet/map_utils.h
+++ b/buffet/map_utils.h
@@ -16,7 +16,7 @@
std::vector<typename T::key_type> GetMapKeys(const T& map) {
std::vector<typename T::key_type> keys;
keys.reserve(map.size());
- for (auto&& pair : map)
+ for (const auto& pair : map)
keys.push_back(pair.first);
return keys;
}
@@ -26,7 +26,7 @@
std::vector<typename T::mapped_type> GetMapValues(const T& map) {
std::vector<typename T::mapped_type> values;
values.reserve(map.size());
- for (auto&& pair : map)
+ for (const auto& pair : map)
values.push_back(pair.second);
return values;
}
@@ -37,7 +37,7 @@
typename T::mapped_type>> MapToVector(const T& map) {
std::vector<std::pair<typename T::key_type, typename T::mapped_type>> vector;
vector.reserve(map.size());
- for (auto&& pair : map)
+ for (const auto& pair : map)
vector.push_back(pair);
return vector;
}