projects
/
profile
/
ivi
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
203a9ac
)
Simplify the code
author
pxli168
<pxli168@163.com>
Mon, 17 Feb 2014 02:21:18 +0000
(10:21 +0800)
committer
pxli168
<pxli168@163.com>
Mon, 17 Feb 2014 02:21:18 +0000
(10:21 +0800)
Simplify the code as @SpecLad suggested.
modules/core/src/command_line_parser.cpp
patch
|
blob
|
history
diff --git
a/modules/core/src/command_line_parser.cpp
b/modules/core/src/command_line_parser.cpp
index
8b7fcad
..
0fa3304
100644
(file)
--- 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;