MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / parseNumber

Function parseNumber

src/Common/parseRemoteDescription.cpp:40–52  ·  view source on GitHub ↗

Parse number from substring

Source from the content-addressed store, hash-verified

38
39/// Parse number from substring
40static bool parseNumber(const String & description, size_t l, size_t r, size_t & res)
41{
42 res = 0;
43 for (size_t pos = l; pos < r; ++pos)
44 {
45 if (!isNumericASCII(description[pos]))
46 return false;
47 res = res * 10 + description[pos] - '0';
48 if (static_cast<double>(res) > 1e15)
49 return false;
50 }
51 return true;
52}
53
54
55std::vector<String> parseRemoteDescription(

Callers 1

parseRemoteDescriptionFunction · 0.70

Calls 1

isNumericASCIIFunction · 0.70

Tested by

no test coverage detected