kopia lustrzana https://gitlab.com/tomaszg/geostat
Cppcheck: decrease variable scope
rodzic
750d620223
commit
f2b0be9e99
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue