From b9fee8b43dc1903ecb08c81405fb83295fc64db9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 23 Jan 2025 16:35:32 +0000 Subject: Convert debug logging from string concatenation to format strings. When running in normal mode this will prevent a bunch of expensive string concatenation. --- src/bancache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bancache.cpp') diff --git a/src/bancache.cpp b/src/bancache.cpp index 27591f0fa..a26e0ab2d 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -58,7 +58,7 @@ bool BanCacheManager::RemoveIfExpired(BanCacheHash::iterator& it) if (ServerInstance->Time() < it->second->Expiry) return false; - ServerInstance->Logs.Debug("BANCACHE", "Hit on " + it->first + " is out of date, removing!"); + ServerInstance->Logs.Debug("BANCACHE", "Hit on {} is out of date, removing!", it->first); delete it->second; it = BanHash.erase(it); return true; @@ -67,7 +67,7 @@ bool BanCacheManager::RemoveIfExpired(BanCacheHash::iterator& it) void BanCacheManager::RemoveEntries(const std::string& type, bool positive) { if (positive) - ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing positive hits for " + type); + ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing positive hits for {}", type); else ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing all negative hits"); @@ -93,7 +93,7 @@ void BanCacheManager::RemoveEntries(const std::string& type, bool positive) if (remove) { /* we need to remove this one. */ - ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing a hit on " + i->first); + ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing a hit on {}", i->first); delete b; i = BanHash.erase(i); } -- cgit v1.3.1-10-gc9f91