Cppcheck: decrease variable scope

sql-rework
Tomasz Golinski 2020-07-06 17:06:40 +02:00
rodzic 750d620223
commit f2b0be9e99
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -105,8 +105,6 @@ void show_histogram(const std::map<std::string, int>& data, const std::string& c
}
void show_nested_histogram(const Caches& cc, std::string Cache::*ptr, std::string Cache::*ptr2, const std::string& caption, bool html, bool sort_by_val) {
int HIST_MAX = 20;
std::map<std::string, int> histogram;
std::vector<std::pair<std::string, int>> pairs;
@ -120,7 +118,9 @@ void show_nested_histogram(const Caches& cc, std::string Cache::*ptr, std::strin
sort(pairs.begin(), pairs.end(), [&](std::pair<std::string, int>& a, std::pair<std::string, int>& b) { return a.first < b.first; });
if (html) {
int HIST_MAX = 20;
int max;
if (sort_by_val)
max = pairs[0].second;
else