[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0909271303580.14151@dr-wily.mit.edu>
Date: Sun, 27 Sep 2009 13:05:01 -0400 (EDT)
From: Tim Abbott <tabbott@...lice.com>
To: Rusty Russell <rusty@...tcorp.com.au>
cc: Alan Jenkins <alan-jenkins@...fmail.co.uk>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-kbuild@...r.kernel.org, linux-modules@...r.kernel.org
Subject: Re: [PATCH 1/2] lib: Add generic binary search function to the
kernel.
On Thu, 24 Sep 2009, Rusty Russell wrote:
> On Thu, 24 Sep 2009 02:58:45 am Tim Abbott wrote:
> > +void *bsearch(const void *key, const void *base, size_t num, size_t size,
> > + int (*cmp)(const void *key, const void *elt))
> > +{
> > + int start = 0, end = num - 1, mid, result;
> > + if (num == 0)
> > + return NULL;
> > +
> > + while (start <= end) {
>
> The if (num == 0) line is superfluous.
You are quite right.
-Tim Abbott
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists