MCPcopy Create free account
hub / github.com/bytedance/bolt / parseDoubleDigit

Function parseDoubleDigit

bolt/type/TimestampConversion.cpp:153–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151inline bool characterIsDigit(char c) {
152 return c >= '0' && c <= '9';
153}
154
155bool parseDoubleDigit(
156 const char* buf,
157 size_t len,
158 size_t& pos,
159 int32_t& result) {
160 if (pos < len && characterIsDigit(buf[pos])) {
161 result = buf[pos++] - '0';
162 if (pos < len && characterIsDigit(buf[pos])) {
163 result = (buf[pos++] - '0') + result * 10;
164 }
165 return true;
166 }
167 return false;
168}
169

Callers 2

tryParseDateStringFunction · 0.85
tryParseTimeStringFunction · 0.85

Calls 1

characterIsDigitFunction · 0.70

Tested by

no test coverage detected