lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VcE8PRTRDg8nqYDu46aTrZiMk_ZxXN6u9UrXWXauga6Ww@mail.gmail.com>
Date:   Thu, 18 May 2017 18:50:39 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Leno Hou <lenohou@...il.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v3 1/2] lib/btree.c: optimise the code by previously
 getpos function

On Thu, May 18, 2017 at 4:40 PM, Leno Hou <lenohou@...il.com> wrote:
> Rework the getpos() helper function and use it to remove various
> open-coded implemetnations of its funtionality.

>         for ( ; height > 1; height--) {
> -               for (i = 0; i < geo->no_pairs; i++)
> -                       if (keycmp(geo, node, i, key) <= 0)
> -                               break;
> -               if (i == geo->no_pairs)
> +               i = getpos(geo, node, key);
> +               if (i < 0)
>                         return -ENOENT;

Now it makes sense to

return i;

instead.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ