X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=763db556654e4c87828854bc7290d056ba8038da;hp=4be580fcbfaf0760974300e02871580549577686;hb=ebe8009affa34708bac1e8b69cf5b925ffe5cc82;hpb=f01b53c37400e676fdf13d52323bc7bb65502e90 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 4be580fc..763db556 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -45,7 +45,7 @@ bool ci_less(char c1, char c2) { return tolower(c1) < tolower(c2); } } bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const { - return lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), ci_less); + return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), ci_less); } @@ -138,14 +138,14 @@ void UCIOption::operator=(const string& v) { assert(!type.empty()); - if ( (type == "button" || !v.empty()) - && (type != "check" || (v == "true" || v == "false")) - && (type != "spin" || (atoi(v.c_str()) >= min && atoi(v.c_str()) <= max))) - { - if (type != "button") - currentValue = v; + if ( (type != "button" && v.empty()) + || (type == "check" && v != "true" && v != "false") + || (type == "spin" && (atoi(v.c_str()) < min || atoi(v.c_str()) > max))) + return; - if (on_change) - (*on_change)(*this); - } + if (type != "button") + currentValue = v; + + if (on_change) + (*on_change)(*this); }