]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/StatHist.cc
Maintenance: Removed most NULLs using modernize-use-nullptr (#1075)
[thirdparty/squid.git] / src / StatHist.cc
index 474fe7c60ed6bb28949f7b80cc87df1506a5aff9..50051ef28993746e4a2417634ddad9f3e596c36c 100644 (file)
@@ -37,7 +37,7 @@ StatHist::init(unsigned int newCapacity, hbase_f * val_in_, hbase_f * val_out_,
 }
 
 StatHist::StatHist(const StatHist &src) :
-    bins(NULL),
+    bins(nullptr),
     capacity_(src.capacity_),
     min_(src.min_),
     max_(src.max_),
@@ -45,7 +45,7 @@ StatHist::StatHist(const StatHist &src) :
     val_in(src.val_in),
     val_out(src.val_out)
 {
-    if (src.bins!=NULL) {
+    if (src.bins!=nullptr) {
         bins = static_cast<bins_type *>(xcalloc(src.capacity_, sizeof(bins_type)));
         memcpy(bins,src.bins,capacity_*sizeof(*bins));
     }
@@ -54,7 +54,7 @@ StatHist::StatHist(const StatHist &src) :
 void
 StatHist::count(double v)
 {
-    if (bins==NULL) //do not count before initialization or after destruction
+    if (bins==nullptr) //do not count before initialization or after destruction
         return;
     const unsigned int bin = findBin(v);
     ++bins[bin];
@@ -190,10 +190,10 @@ StatHist::operator += (const StatHist &B)
     Must(min_ == B.min_);
     Must(max_ == B.max_);
 
-    if (B.bins == NULL) { // B was not yet initializted
+    if (B.bins == nullptr) { // B was not yet initializted
         return *this;
     }
-    if (bins == NULL) { // this histogram was not yet initialized
+    if (bins == nullptr) { // this histogram was not yet initialized
         *this = B;
         return *this;
     }