]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Reformat
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 15 Sep 2020 11:23:51 +0000 (13:23 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 15 Sep 2020 11:39:53 +0000 (13:39 +0200)
pdns/recursordist/negcache.cc
pdns/recursordist/negcache.hh

index 5897ffb725ab06ec4b17b6e4a0287b9e15fbd9eb..3f4c13a130a384477442151d56248915a7dabdd6 100644 (file)
@@ -26,7 +26,8 @@
 #include "cachecleaner.hh"
 #include "utility.hh"
 
-NegCache::NegCache(size_t mapsCount) : d_maps(mapsCount)
+NegCache::NegCache(size_t mapsCount) :
+  d_maps(mapsCount)
 {
 }
 
@@ -39,7 +40,7 @@ NegCache::~NegCache()
       locks.push_back(lock_t(new lock(map)));
     }
   }
-  catch(...) {
+  catch (...) {
   }
 }
 
index 894d07501b7284fa1ef476de97e024abe4a469d8..d27432426e073a1919fa4f79ae75f2085f13701c 100644 (file)
@@ -49,7 +49,6 @@ typedef struct
 class NegCache : public boost::noncopyable
 {
 public:
-
   NegCache(size_t mapsCount = 1024);
   ~NegCache();
 
@@ -109,8 +108,8 @@ private:
   struct MapCombo
   {
     MapCombo() {}
-    MapCombo(const MapCombo &) = delete;
-    MapCombo & operator=(const MapCombo &) = delete;
+    MapCombo(const MapCombo&) = delete;
+    MapCombo& operator=(const MapCombo&) = delete;
     negcache_t d_map;
     mutable std::mutex mutex;
     std::atomic<uint64_t> d_entriesCount{0};
@@ -121,17 +120,20 @@ private:
 
   vector<MapCombo> d_maps;
 
-  MapCombo& getMap(const DNSName &qname)
+  MapCombo& getMap(const DNSNameqname)
   {
     return d_maps[qname.hash() % d_maps.size()];
   }
-  const MapCombo& getMap(const DNSName &qname) const
+  const MapCombo& getMap(const DNSNameqname) const
   {
     return d_maps[qname.hash() % d_maps.size()];
   }
+
 public:
-  struct lock {
-    lock(const MapCombo& map) : m(map.mutex)
+  struct lock
+  {
+    lock(const MapCombo& map) :
+      m(map.mutex)
     {
       if (!m.try_lock()) {
         m.lock();
@@ -139,11 +141,12 @@ public:
       }
       map.d_acquired_count++;
     }
-    ~lock() {
+    ~lock()
+    {
       m.unlock();
     }
+
   private:
-    std::mutex &m;
+    std::mutexm;
   };
-
 };