neteja cppcheck (105 → 0)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <algorithm> // Para max, clamp
|
||||
#include <cstddef> // Para size_t
|
||||
#include <functional> // Para function
|
||||
#include <numeric> // Para accumulate
|
||||
#include <string> // Para allocator, string, basic_string, to_string, operator==, char_traits
|
||||
#include <utility> // Para move
|
||||
#include <vector> // Para vector
|
||||
@@ -174,11 +175,7 @@ class ListOption : public MenuOption {
|
||||
setter_(value_list_[list_index_]);
|
||||
}
|
||||
auto getMaxValueWidth(Text* text_renderer) const -> int override {
|
||||
int max_w = 0;
|
||||
for (const auto& val : value_list_) {
|
||||
max_w = std::max(max_w, text_renderer->length(val, -2));
|
||||
}
|
||||
return max_w;
|
||||
return std::accumulate(value_list_.begin(), value_list_.end(), 0, [text_renderer](int max_w, const auto& val) { return std::max(max_w, text_renderer->length(val, -2)); });
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user