Minor clean-ups noticed during string-parsing improvements
Simplify a conditional to save some repetition, purge some spurious parentheses. Change-Id: I727d22ce81733e765c4ee951475ccdb599063399 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
9c58870423
commit
dd5fc20e90
@ -115,10 +115,8 @@ static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptL
|
||||
}
|
||||
address |= x;
|
||||
|
||||
if (dotCount == 3 && *endptr != '\0')
|
||||
return false;
|
||||
else if (dotCount == 3 || *endptr == '\0')
|
||||
return true;
|
||||
if (dotCount == 3 || *endptr == '\0')
|
||||
return *endptr == '\0';
|
||||
if (*endptr != '.')
|
||||
return false;
|
||||
|
||||
|
@ -452,7 +452,7 @@ static QVersionNumber from_string(QLatin1String string, qsizetype *suffixIndex)
|
||||
seg.append(int(value));
|
||||
start = end + 1;
|
||||
lastGoodEnd = end;
|
||||
} while (start < endOfString && (end < endOfString && *end == '.'));
|
||||
} while (start < endOfString && end < endOfString && *end == '.');
|
||||
|
||||
if (suffixIndex)
|
||||
*suffixIndex = lastGoodEnd - string.begin();
|
||||
|
Loading…
Reference in New Issue
Block a user