diff options
Diffstat (limited to 'src/zenstore/filecas.cpp')
| -rw-r--r-- | src/zenstore/filecas.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp index 339e5de0a..82dbe3551 100644 --- a/src/zenstore/filecas.cpp +++ b/src/zenstore/filecas.cpp @@ -57,16 +57,14 @@ GetFileCasTag() return _; } -namespace { +namespace filecas::impl { template<typename T> void Reset(T& V) { T Tmp; V.swap(Tmp); } -} // namespace -namespace filecas::impl { const char* IndexExtension = ".uidx"; const char* LogExtension = ".ulog"; @@ -141,11 +139,11 @@ FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& Roo ////////////////////////////////////////////////////////////////////////// -static const float IndexMinLoadFactor = 0.2f; -static const float IndexMaxLoadFactor = 0.7f; - FileCasStrategy::FileCasStrategy(GcManager& Gc) : m_Log(logging::Get("filecas")), m_Gc(Gc) { + static const float IndexMinLoadFactor = 0.2f; + static const float IndexMaxLoadFactor = 0.7f; + m_Index.min_load_factor(IndexMinLoadFactor); m_Index.max_load_factor(IndexMaxLoadFactor); @@ -1237,7 +1235,7 @@ public: Stopwatch Timer; const auto _ = MakeGuard([&] { - Reset(m_ReferencesToClean); + filecas::impl::Reset(m_ReferencesToClean); if (!Ctx.Settings.Verbose) { return; @@ -1353,7 +1351,7 @@ public: } } - Reset(m_ReferencesToClean); + filecas::impl::Reset(m_ReferencesToClean); } virtual std::string GetGcName(GcCtx& Ctx) override { return m_FileCasStrategy.GetGcName(Ctx); } |