lkml.org 
[lkml]   [2019]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lib/string.c: make strncmp() smaller
On Fri, Feb 08, 2019 at 01:31:49AM -0800, Joe Perches wrote:
> On Fri, 2019-02-08 at 10:34 +0300, Alexey Dobriyan wrote:

> > - return c1 < c2 ? -1 : 1;
> > + return c1 - c2;
>
> This does change the return value for most comparisons.

It does.

> Wasn't there a specific reason for -1 and 1?

Maybe. Spec says anything positive or negative works.

\
 
 \ /
  Last update: 2019-02-09 14:03    [W:0.081 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site