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

Method _save

ci/iwyu_cache.py:116–125  ·  view source on GitHub ↗

Persist cache to disk.

(self)

Source from the content-addressed store, hash-verified

114 self._data = {}
115
116 def _save(self) -> None:
117 """Persist cache to disk."""
118 if not self._enabled:
119 return
120 try:
121 _CACHE_DIR.mkdir(parents=True, exist_ok=True)
122 with open(_CACHE_FILE, "w") as f:
123 json.dump(self._data, f, separators=(",", ":"))
124 except OSError:
125 pass # Non-fatal
126
127 def get(self, file_path: Path, compiler_args_key: str) -> list[str] | None:
128 """Look up cached IWYU result for a file.

Callers 1

saveMethod · 0.95

Calls 1

dumpMethod · 0.45

Tested by

no test coverage detected