Less branches

This commit is contained in:
alesapin 2019-08-01 20:46:37 +03:00
parent 7c37450c3d
commit ca3796f0a3

View File

@ -74,8 +74,6 @@ void SettingNumber<bool>::set(const String & x)
set(false); set(false);
else if (x[0] == '1') else if (x[0] == '1')
set(true); set(true);
else
throw Exception("Cannot parse bool from string '" + x + "'", ErrorCodes::CANNOT_PARSE_BOOL);
} }
else else
{ {
@ -84,9 +82,9 @@ void SettingNumber<bool>::set(const String & x)
set(true); set(true);
else if (checkStringCaseInsensitive("false", buf)) else if (checkStringCaseInsensitive("false", buf))
set(false); set(false);
else
throw Exception("Cannot parse bool from string '" + x + "'", ErrorCodes::CANNOT_PARSE_BOOL);
} }
if (!changed)
throw Exception("Cannot parse bool from string '" + x + "'", ErrorCodes::CANNOT_PARSE_BOOL);
} }
template <typename Type> template <typename Type>