mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 13:05:20 +01:00
fix extract bool
This commit is contained in:
parent
6972d2832e
commit
83bbab4112
@ -343,19 +343,21 @@ inline bool extract(const char* begin, const char* end, bool& value) {
|
|||||||
value = true;
|
value = true;
|
||||||
} else if (*begin == '0') {
|
} else if (*begin == '0') {
|
||||||
value = false;
|
value = false;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
size_t size = end - begin;
|
size_t size = end - begin;
|
||||||
if (size == 4 && strncmp(begin, "true", size) == 0) {
|
if (size == 4 && strncmp(begin, "true", size) == 0) {
|
||||||
value = true;
|
value = true;
|
||||||
} else if (size == 5 && strncmp(begin, "false", size) == 0) {
|
} else if (size == 5 && strncmp(begin, "false", size) == 0) {
|
||||||
value = false;
|
value = false;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
Loading…
Reference in New Issue
Block a user