MCPcopy Create free account
hub / github.com/Luce-Org/lucebox-hub / parse_int_list

Function parse_int_list

server/test/test_dflash.cpp:210–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208using dflash::common::activation_pair_init;
209using dflash::common::find_layer_split_shard;
210
211static bool parse_int_list(const char * text, std::vector<int> & out) {
212 out.clear();
213 if (!text || !*text) return false;
214 const char * p = text;
215 while (*p) {
216 char * end = nullptr;
217 long v = std::strtol(p, &end, 10);
218 if (end == p || v < 0 || v > INT32_MAX) return false;
219 out.push_back((int)v);
220 if (*end == '\0') break;
221 if (*end != ',') return false;
222 p = end + 1;
223 }
224 return !out.empty();
225}
226
227static bool parse_float_list(const char * text, std::vector<double> & out) {

Callers 1

mainFunction · 0.70

Calls 2

clearMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected