mirror of
https://github.com/opencv/opencv.git
synced 2025-06-24 04:36:26 +08:00
Simplify the code
Simplify the code as @SpecLad suggested.
This commit is contained in:
parent
203a9acdbc
commit
70d462b352
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user