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

Function write_counted_i32

server/src/common/daemon_loop.cpp:173–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 std::ifstream f(path, std::ios::binary);
172 if (!f) return {};
173 uint32_t n = 0;
174 f.read(reinterpret_cast<char *>(&n), sizeof(n));
175 if (!f) return {};
176 std::vector<int32_t> ids((size_t)n);
177 if (n > 0) {
178 f.read(reinterpret_cast<char *>(ids.data()),
179 (std::streamsize)ids.size() * sizeof(int32_t));
180 if (!f) return {};
181 }
182 return ids;
183}
184
185static bool write_counted_i32(const std::string & path,
186 const std::vector<int32_t> & ids) {

Callers 1

run_daemonFunction · 0.70

Calls 3

writeMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected