if not self._caches or opts.cache_locally():
self._caches.append(ClangTidyLocalCache(log, opts))
I'd expect the local cache to be prepended to the list, rather than appended, such that methods like is_cached and get_cache_data would check the local cache first, and hence avoid making more expensive remote calls.
Am I missing something obvious here? If not, would it make sense to tweak this?
I've made some small changes to add the local cache as the first one if it is enabled in the options or to use it as the fallback if there are none others.
I was perusing the code a little more in the context of https://github.com/matus-chochlik/ctcache/issues/50, and stumbled upon the logic that adds the caches:
https://github.com/matus-chochlik/ctcache/blob/main/clang-tidy-cache#L896
I'd expect the local cache to be prepended to the list, rather than appended, such that methods like
is_cached
andget_cache_data
would check the local cache first, and hence avoid making more expensive remote calls.Am I missing something obvious here? If not, would it make sense to tweak this?