Commit 70d462b3 authored by pxli168's avatar pxli168

Simplify the code

Simplify the code as @SpecLad suggested.
parent 203a9acd
...@@ -65,8 +65,7 @@ static void from_str(const String& str, int type, void* dst) ...@@ -65,8 +65,7 @@ static void from_str(const String& str, int type, void* dst)
{ {
std::string temp; std::string temp;
ss >> temp; ss >> temp;
if( !temp.compare("true") ) *(bool*)dst = true; *(bool*) = temp == "true";
else *(bool*)dst = false;
} }
else if( type == Param::UNSIGNED_INT ) else if( type == Param::UNSIGNED_INT )
ss >> *(unsigned*)dst; ss >> *(unsigned*)dst;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment