Re: [MERGE] c++-refactor HttpHdrCc

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 14 Sep 2011 15:57:11 +1200

 On Tue, 13 Sep 2011 10:11:55 -0600, Alex Rousskov wrote:
 <snip>
>> void
>> +HttpHdrCc::clear()
>> +{
>> + mask=0;
>> + max_age=-1;
>> + mask=0;
>> + max_age=-1;
>> + s_maxage=-1;
>> + max_stale=-1;
>> + stale_if_error=0;
>> + min_fresh=-1;
>> + other.clean();
>> +}
>
> This duplicates the default constructor. Mask and max_age are cleared
> twice. Consider this implementation instead (which can be inlined):
>
> *this = HttpHdrCc();
>

 Nice.

 We use ~Foo(){clear();} in quite a few places. Do you have any info
 which is faster?

 Amos
Received on Wed Sep 14 2011 - 03:57:14 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 14 2011 - 12:00:05 MDT