From b1ce7ce328e322cafa2401af77a9334c61b72034 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 2 Jul 2024 15:12:44 +0200 Subject: Convert StorageConfig to a general class --- src/buildtool/storage/garbage_collector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/buildtool/storage/garbage_collector.cpp') diff --git a/src/buildtool/storage/garbage_collector.cpp b/src/buildtool/storage/garbage_collector.cpp index 3b3e5d28..25a78ddb 100644 --- a/src/buildtool/storage/garbage_collector.cpp +++ b/src/buildtool/storage/garbage_collector.cpp @@ -175,11 +175,11 @@ auto GarbageCollector::TriggerGarbageCollection( storage_config.CacheRoot() / fmt::format("{}{}", remove_me_prefix, remove_me_counter++); to_remove.emplace_back(remove_me_dir); - for (std::size_t i = storage_config.NumGenerations(); i > 0; --i) { + for (std::size_t i = storage_config.num_generations; i > 0; --i) { auto cache_root = storage_config.GenerationCacheRoot(i - 1); if (FileSystemManager::IsDirectory(cache_root)) { auto new_cache_root = - (i == storage_config.NumGenerations()) + (i == storage_config.num_generations) ? remove_me_dir : storage_config.GenerationCacheRoot(i); if (not FileSystemManager::Rename(cache_root, -- cgit v1.2.3