| 151 | inline bool characterIsDigit(char c) { |
| 152 | return c >= '0' && c <= '9'; |
| 153 | } |
| 154 | |
| 155 | bool 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 |
no test coverage detected