Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

2012-07-03 Thread Henrik Nordström
tis 2012-07-03 klockan 07:52 +0200 skrev Kinkie: ++(conn_-getPeer()-stats.conn_open); IMHO we should consistently use bracketing as above to clarify in situations like this where there is any complex location syntax. It is the latter, but I had the some doubt so I double-checked. I

Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

2012-07-03 Thread Kinkie
Usually the other ++ works better in readability conn_-getPeer()-stats.conn_open++; or even conn_-getPeer()-stats.conn_open += 1; With GCC this code: 15 int a=0; 16 a++; 17 ++a; 18 a+=1; gets assembled as: 16 a++; = 0x0804873c

Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

2012-07-03 Thread Alex Rousskov
On 07/02/2012 04:34 PM, Amos Jeffries wrote: On 03.07.2012 03:30, Francesco Chemolli wrote: -if (conn_-getPeer()) -conn_-getPeer()-stats.conn_open++; +if (peer *peer=(conn_-getPeer())) +++peer-stats.conn_open; lookupLocalAddress(); Two points: 1)

Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

2012-07-03 Thread Amos Jeffries
On 03.07.2012 21:27, Kinkie wrote: Usually the other ++ works better in readability conn_-getPeer()-stats.conn_open++; or even conn_-getPeer()-stats.conn_open += 1; With GCC this code: 15 int a=0; 16 a++; 17 ++a; 18 a+=1; gets assembled

Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

2012-07-02 Thread Amos Jeffries
On 03.07.2012 03:30, Francesco Chemolli wrote: -if (conn_-getPeer()) -conn_-getPeer()-stats.conn_open++; +if (peer *peer=(conn_-getPeer())) +++peer-stats.conn_open; lookupLocalAddress(); Two points: 1) assignment in the if() needs to be double-bracketed around

Re: /bzr/squid3/trunk/ r12194: Small optimization in CommOpener statistic accounting.

2012-07-02 Thread Kinkie
On Tue, Jul 3, 2012 at 12:34 AM, Amos Jeffries squ...@treenet.co.nz wrote: On 03.07.2012 03:30, Francesco Chemolli wrote: -if (conn_-getPeer()) -conn_-getPeer()-stats.conn_open++; +if (peer *peer=(conn_-getPeer())) +++peer-stats.conn_open;