Simplify the code

Simplify the code as @SpecLad suggested.
This commit is contained in:
pxli168 2014-02-17 10:21:18 +08:00
parent 203a9acdbc
commit 70d462b352

View File

@ -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;