| 172 | } |
| 173 | |
| 174 | bool FastStringTo32(const char* str, int32_t* value) { |
| 175 | char* end = nullptr; |
| 176 | errno = 0; |
| 177 | int64_t ret = strtol(str, &end, 10); |
| 178 | while (isspace(*end)) ++end; |
| 179 | if (*end == '\0' && errno == 0 && |
| 180 | ret <= std::numeric_limits<int>::max() && |
| 181 | ret >= std::numeric_limits<int>::min() ) { |
| 182 | *value = ret; |
| 183 | return true; |
| 184 | } |
| 185 | return false; |
| 186 | } |
| 187 | |
| 188 | bool FastStringTo64(const char* str, int64_t* value) { |
| 189 | char* end = nullptr; |
no outgoing calls
no test coverage detected