From: Amos Jeffries Date: Mon, 14 May 2012 12:45:54 +0000 (+1200) Subject: Make StatHist::clear inline to reduce dependencies X-Git-Tag: BumpSslServerFirst.take08~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb75f92e910f8153bb0c24487d8320d277eeace;p=thirdparty%2Fsquid.git Make StatHist::clear inline to reduce dependencies --- diff --git a/src/StatHist.cc b/src/StatHist.cc index 422ea742ce..a56c547d79 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -59,14 +59,6 @@ StatHist::init(unsigned int newCapacity, hbase_f * val_in_, hbase_f * val_out_, scale_ = capacity_ / val_in(max_ - min_); } -void -StatHist::clear() -{ - xfree(bins); // can handle case of bins being NULL - bins=NULL; - capacity_=0; // mark as destructed, may be needed for troubleshooting -} - StatHist::StatHist(const StatHist &src) : capacity_(src.capacity_), min_(src.min_), max_(src.max_), scale_(src.scale_), val_in(src.val_in), val_out(src.val_out) diff --git a/src/StatHist.h b/src/StatHist.h index b422ce7ba7..05db311271 100644 --- a/src/StatHist.h +++ b/src/StatHist.h @@ -148,4 +148,12 @@ StatHist::StatHist() : scale_(1.0), val_in(NULL), val_out(NULL) {} +inline void +StatHist::clear() +{ + xfree(bins); // can handle case of bins being NULL + bins=NULL; + capacity_=0; // mark as destructed, may be needed for troubleshooting +} + #endif /* STATHIST_H_ */ diff --git a/src/tests/stub_StatHist.cc b/src/tests/stub_StatHist.cc index cf0cfdfd4e..f3d70947d3 100644 --- a/src/tests/stub_StatHist.cc +++ b/src/tests/stub_StatHist.cc @@ -24,10 +24,6 @@ double statHistDeltaPctile(const StatHist & A, const StatHist & B, double pctile) STUB_RETVAL(0.0) -void -StatHist::clear() -STUB - void StatHist::logInit(unsigned int i, double d1, double d2) STUB