<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 6, 2014 at 8:22 PM, Anton Altaparmakov <span dir="ltr"><<a href="mailto:aia21@cam.ac.uk" target="_blank">aia21@cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> On 7 Nov 2014, at 01:46, Jeff Moyer <<a href="mailto:jmoyer@redhat.com">jmoyer@redhat.com</a>> wrote:<br>
> Minor nit, but I'd rather read something that looks like this:<br>
><br>
> if (type == READ && (flags & RWF_NONBLOCK))<br>
> return -EAGAIN;<br>
> else if (type == WRITE && (flags & RWF_DSYNC))<br>
> return -EINVAL;<br>
<br>
But your version is less logically efficient for the case where "type == READ" is true and "flags & RWF_NONBLOCK" is false because your version then has to do the "if (type == WRITE" check before discovering it does not need to take that branch either, whilst the original version does not have to do such a test at all.<br></blockquote><div><br></div><div>Seriously? Just focus on the code readability/maintainability which makes the code most easily understood/obvious to a new pair of eyes, and leave such micro-optimizations to the compiler..</div><div><br></div></div>Thanks</div></div>