Re: [hackers] [ubase] Fix style issue || sin

From: sin <sin_AT_2f30.org>
Date: Thu, 6 Mar 2014 17:08:20 +0000

On Thu, Mar 06, 2014 at 03:55:14PM +0100, FRIGN wrote:
> On Thu, 6 Mar 2014 15:36:43 +0000
> sin <sin_AT_2f30.org> wrote:
>
> > Another question, do you use < 0 or == -1? I am talking
> > about checking the return value of open(2) etc.
>
> I think it'd be interesting what's less demanding.
> I suppose "< 0" is more efficient, as there's only a check to the
> sign-bit, whereas comparing two integers (== -1) involves at
> most 8 bit-operations for an 8 bit integer (others respectively).

I am no compiler guru but since these are constants they compiler
may optimize this anyhow.

I was mostly talking in terms of readability.
Received on Thu Mar 06 2014 - 18:08:20 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 06 2014 - 18:12:15 CET