diff --git a/modules/core/src/command_line_parser.cpp b/modules/core/src/command_line_parser.cpp index 8b7fcad6b3..0fa3304889 100644 --- a/modules/core/src/command_line_parser.cpp +++ b/modules/core/src/command_line_parser.cpp @@ -65,8 +65,7 @@ static void from_str(const String& str, int type, void* dst) { std::string temp; ss >> temp; - if( !temp.compare("true") ) *(bool*)dst = true; - else *(bool*)dst = false; + *(bool*) = temp == "true"; } else if( type == Param::UNSIGNED_INT ) ss >> *(unsigned*)dst;