Fixed style.

This commit is contained in:
Michal Tabaszewski 2024-08-17 01:54:46 +02:00 committed by Robert Schulze
parent 4f799467ec
commit cd51535a67
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
5 changed files with 10 additions and 9 deletions

View File

@ -70,9 +70,9 @@ public:
void removeWithPredicate(std::function<bool(const Key&, const MappedPtr&)> predicate) override
{
for(auto it = cells.begin(); it != cells.end();)
for (auto it = cells.begin(); it != cells.end();)
{
if(predicate(it->first, it->second.value))
if (predicate(it->first, it->second.value))
{
auto & cell = it->second;
current_size_in_bytes -= cell.size;

View File

@ -97,9 +97,9 @@ public:
void removeWithPredicate(std::function<bool(const Key&, const MappedPtr&)> predicate) override
{
for(auto it = cells.begin(); it != cells.end();)
for (auto it = cells.begin(); it != cells.end();)
{
if(predicate(it->first, it->second.value))
if (predicate(it->first, it->second.value))
{
auto & cell = it->second;

View File

@ -135,9 +135,9 @@ public:
void removeWithPredicate(std::function<bool(const Key&, const MappedPtr&)> predicate) override
{
for(auto it = cache.begin(); it != cache.end();)
for (auto it = cache.begin(); it != cache.end();)
{
if(predicate(it->first, it->second))
if (predicate(it->first, it->second))
{
size_t sz = weight_function(*it->second);
if (it->first.user_id.has_value())

View File

@ -621,10 +621,11 @@ QueryCache::Writer QueryCache::createWriter(const Key & key, std::chrono::millis
void QueryCache::clearWithTag(const String & tag)
{
auto removeWithTag = [tag](const Key & k, const Cache::MappedPtr & _){
auto remove_with_tag = [tag](const Key & k, const Cache::MappedPtr & _)
{
return k.tag == tag;
};
cache.removeWithPredicate(removeWithTag);
cache.removeWithPredicate(remove_with_tag);
std::lock_guard lock(mutex);
}

View File

@ -370,7 +370,7 @@ BlockIO InterpreterSystemQuery::execute()
break;
case Type::DROP_QUERY_CACHE:
{
getContext()->checkAccess(AccessType::SYSTEM_DROP_QUERY_CACHE);
getContext()->checkAccess(AccessType::SYSTEM_DROP_QUERY_CACHE);
!query.query_cache_tag.empty() ? getContext()->clearQueryCacheWithTag(query.query_cache_tag): getContext()->clearQueryCache();
break;
}