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

Function _findOrCreate

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

Source from the content-addressed store, hash-verified

256}
257
258FileDataPtr _findOrCreate(const fl::string &path, size_t len) {
259 auto &reg = FileRegistry::instance();
260 fl::unique_lock<fl::mutex> lock(reg.mutex);
261 auto it = reg.files.find(path);
262 if (it != reg.files.end()) {
263 return it->second;
264 }
265 auto entry = fl::make_shared<FileData>(len);
266 reg.files.insert(fl::make_pair(path, entry)); // okay fl namespace
267 return entry;
268}
269
270FileDataPtr _createIfNotExists(const fl::string &path, size_t len) {
271 auto &reg = FileRegistry::instance();

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected