]> git.sesse.net Git - stockfish/blobdiff - src/ucioption.cpp
Reduce indentation in UCIOption::operator=()
[stockfish] / src / ucioption.cpp
index 4be580fcbfaf0760974300e02871580549577686..763db556654e4c87828854bc7290d056ba8038da 100644 (file)
@@ -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);
 }