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

From: FRIGN <dev_AT_frign.de>
Date: Thu, 6 Mar 2014 15:55:14 +0100

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).

Thus, I'd go for "< 0", but I'm open for your suggestions.

Cheers

FRIGN

PS: I know this doesn't make much of a difference in performance :P

-- 
FRIGN <dev_AT_frign.de>
Received on Thu Mar 06 2014 - 15:55:14 CET

This archive was generated by hypermail 2.3.0 : Thu Mar 06 2014 - 18:00:13 CET