X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=763db556654e4c87828854bc7290d056ba8038da;hp=4761004d735555696f5c22d1b60ff55e190a5fff;hb=ebe8009affa34708bac1e8b69cf5b925ffe5cc82;hpb=caef31921900e092616c56193e37201b08baa875 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 4761004d..763db556 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -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 (on_change) - (*on_change)(*this); - } + 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 (type != "button") + currentValue = v; + + if (on_change) + (*on_change)(*this); }