mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
string2ll(): remove duplicated check for special case.
Related to #5157. The PR author correctly indentified that the check was duplicated, but removing the second one introduces a bug that was fixed in the past (hence the duplication). Instead we can remove the first instance of the check without issues.
This commit is contained in:
parent
1daee8c748
commit
e8f5d21940
@ -349,12 +349,7 @@ int string2ll(const char *s, size_t slen, long long *value) {
|
|||||||
if (plen == slen)
|
if (plen == slen)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Special case: first and only digit is 0. */
|
/* Handle negative integers. */
|
||||||
if (slen == 1 && p[0] == '0') {
|
|
||||||
if (value != NULL) *value = 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p[0] == '-') {
|
if (p[0] == '-') {
|
||||||
negative = 1;
|
negative = 1;
|
||||||
p++; plen++;
|
p++; plen++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user