From 648f813f8c89e6e7d0ed5bda2c2149bee2babb09 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 22 Jul 2022 18:33:38 +0100 Subject: Switch from NULL to nullptr. --- src/bancache.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bancache.cpp') diff --git a/src/bancache.cpp b/src/bancache.cpp index db11840ef..a79c94544 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -34,8 +34,8 @@ BanCacheHit::BanCacheHit(const std::string& type, const std::string& reason, tim BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds) { BanCacheHit*& b = BanHash[ip]; - if (b != NULL) // can't have two cache entries on the same IP, sorry.. - return NULL; + if (b != nullptr) // can't have two cache entries on the same IP, sorry.. + return nullptr; b = new BanCacheHit(type, reason, (seconds ? seconds : 86400)); return b; @@ -46,10 +46,10 @@ BanCacheHit *BanCacheManager::GetHit(const std::string &ip) BanCacheHash::iterator i = this->BanHash.find(ip); if (i == this->BanHash.end()) - return NULL; // free and safe + return nullptr; // free and safe if (RemoveIfExpired(i)) - return NULL; // expired + return nullptr; // expired return i->second; // hit. } -- cgit v1.3.1-10-gc9f91