MCPcopy Create free account
hub / github.com/FastLED/FastLED / _createIfNotExists

Function _createIfNotExists

src/platforms/wasm/fs_wasm.cpp.hpp:270–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270FileDataPtr _createIfNotExists(const fl::string &path, size_t len) {
271 auto &reg = FileRegistry::instance();
272 fl::unique_lock<fl::mutex> lock(reg.mutex);
273 auto it = reg.files.find(path);
274 if (it != reg.files.end()) {
275 return FileDataPtr();
276 }
277 auto entry = fl::make_shared<FileData>(len);
278 reg.files.insert(fl::make_pair(path, entry)); // okay fl namespace
279 return entry;
280}
281
282} // namespace fl
283

Callers 2

jsInjectFileFunction · 0.85
jsDeclareFileFunction · 0.85

Calls 4

make_pairFunction · 0.85
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected