MCPcopy Create free account
hub / github.com/catboost/catboost / ParseFast

Method ParseFast

util/string/cast.cpp:139–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 static inline bool ParseFast(const TChar* pos, const TChar* end, T* target) noexcept {
140 T result = T();
141 T d1;
142 T d2;
143
144 // we have end > pos
145 auto beforeEnd = end - 1;
146
147 while (pos < beforeEnd && CharToDigit<base>(*pos, &d1) && CharToDigit<base>(*(pos + 1), &d2)) {
148 result = result * BASE_POW_2 + d1 * base + d2;
149 pos += 2;
150 }
151
152 while (pos != end && CharToDigit<base>(*pos, &d1)) {
153 result = result * base + d1;
154 ++pos;
155 }
156
157 *target = result;
158
159 return pos == end;
160 }
161
162 static inline EParseStatus ParseSlow(const TChar** ppos, const TChar* end, T max, T* target) noexcept {
163 T result = T();

Callers

nothing calls this directly

Calls 1

TClass · 0.70

Tested by

no test coverage detected