Commit 8c42e1bf authored by gsell's avatar gsell
Browse files

use std::minmax() in Profile class of BET

parent 782d45e0
......@@ -193,16 +193,11 @@ double Profile::get(double xa, Interpol_type /*tp*/) {
low = k;
}
}
double y_min = y[low];
double y_max = y[high];
if (y_min > y_max) {
y_min = y[high];
y_max = y[low];
}
if (val < y_min) {
val = y_min;
} else if (val > y_max) {
val = y_max;
std::pair<double, double> y_minmax = std::minmax({y[low], y[high]});
if (val < y_minmax.first) {
val = y_minmax.first;
} else if (val > y_minmax.second) {
val = y_minmax.second;
}
return (sf * val);
}
......
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