Unverified Commit df415adb by Dominic Hamon Committed by GitHub

Some small clang-tidy fixes (#520)

parent 4fe0206b
...@@ -30,7 +30,7 @@ auto StatisticsSum = [](const std::vector<double>& v) { ...@@ -30,7 +30,7 @@ auto StatisticsSum = [](const std::vector<double>& v) {
}; };
double StatisticsMean(const std::vector<double>& v) { double StatisticsMean(const std::vector<double>& v) {
if (v.size() == 0) return 0.0; if (v.empty()) return 0.0;
return StatisticsSum(v) * (1.0 / v.size()); return StatisticsSum(v) * (1.0 / v.size());
} }
...@@ -62,7 +62,7 @@ auto Sqrt = [](const double dat) { ...@@ -62,7 +62,7 @@ auto Sqrt = [](const double dat) {
double StatisticsStdDev(const std::vector<double>& v) { double StatisticsStdDev(const std::vector<double>& v) {
const auto mean = StatisticsMean(v); const auto mean = StatisticsMean(v);
if (v.size() == 0) return mean; if (v.empty()) return mean;
// Sample standard deviation is undefined for n = 1 // Sample standard deviation is undefined for n = 1
if (v.size() == 1) if (v.size() == 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment