public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Patch to improve readability of sock_rcvlowat() - comments wanted...
       [not found] <3AF72A19.7030009@eisenstein.dk>
@ 2001-05-07 21:55 ` Ronald Bultje
  2001-05-09 20:09   ` Jesper Juhl
  0 siblings, 1 reply; 2+ messages in thread
From: Ronald Bultje @ 2001-05-07 21:55 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linux-kernel


On 2001.05.08 01:04:57 +0200 Jesper Juhl wrote:
> 
> static inline int sock_rcvlowat(struct sock *sk, int waitall, int len)
> {
>          int r = len;
>          if (!waitall)
>                  r = min(sk->rcvlowat, len);
>          return max(1,r);
> }
> 

return max(1, waitall ? len : min(sk->rcvlowat, len));

Although I doubt this is more readable... :-)

--
Ronald


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch to improve readability of sock_rcvlowat() - comments wanted...
  2001-05-07 21:55 ` Patch to improve readability of sock_rcvlowat() - comments wanted Ronald Bultje
@ 2001-05-09 20:09   ` Jesper Juhl
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Juhl @ 2001-05-09 20:09 UTC (permalink / raw)
  To: Ronald Bultje; +Cc: linux-kernel

Ronald Bultje wrote:

> On 2001.05.08 01:04:57 +0200 Jesper Juhl wrote:
> 
>> static inline int sock_rcvlowat(struct sock *sk, int waitall, int len)
>> {
>>          int r = len;
>>          if (!waitall)
>>                  r = min(sk->rcvlowat, len);
>>          return max(1,r);
>> }
>> 
> 
> 
> return max(1, waitall ? len : min(sk->rcvlowat, len));
> 
> Although I doubt this is more readable... :-)
> 

IMO your version is less readable than the 4-liner above, and the code 
it generates is a lot bigger than both the original and the proposed 
replacement - but thank you for the suggestion...

- Jesper Juhl - juhl@eisenstein.dk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-05-08 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3AF72A19.7030009@eisenstein.dk>
2001-05-07 21:55 ` Patch to improve readability of sock_rcvlowat() - comments wanted Ronald Bultje
2001-05-09 20:09   ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox