[patch] Two minor patches about buffer and typo in DOC

2013-07-01 Thread Godbach
HiWilly, There are two patches for your informationwith patch 0002 is just a typo fix. For patch 0001, the orignal code confuses me that why bitwise OR isused to check if the buffer is empty or not as below: static inline int buffer_not_empty(const struct buffer *buf) { return buf-i | buf-o; }

Re: [patch] Two minor patches about buffer and typo in DOC

2013-07-01 Thread Willy Tarreau
Hi, On Tue, Jul 02, 2013 at 01:37:28AM +0800, Godbach wrote: HiWilly, There are two patches for your informationwith patch 0002 is just a typo fix. OK applied, thanks. For patch 0001, the orignal code confuses me that why bitwise OR isused to check if the buffer is empty or not as below:

Re: [patch] Two minor patches about buffer and typo in DOC

2013-07-01 Thread Godbach
No it's not an error, it's intentional. The result is the same (eg: only i==0 o==0 will return 0), except that the bitwise OR produces more efficient code than the logical one which depending on the compiler and code will produce conditional jumps and explicit setting to 1 or 0. Since a