Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753967Ab3GOFTd (ORCPT ); Mon, 15 Jul 2013 01:19:33 -0400 Received: from ozlabs.org ([203.10.76.45]:44154 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752710Ab3GOFTb (ORCPT ); Mon, 15 Jul 2013 01:19:31 -0400 From: Rusty Russell To: Wedson Almeida Filho , Joe Perches Cc: Tim Abbott , linux-kernel@vger.kernel.org, Wedson Almeida Filho Subject: Re: [PATCH v2] lib: One less subtraction in binary search iterations. In-Reply-To: <1373351822-52050-1-git-send-email-wedsonaf@gmail.com> References: <1373351822-52050-1-git-send-email-wedsonaf@gmail.com> User-Agent: Notmuch/0.15.2+81~gd2c8818 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Mon, 15 Jul 2013 14:37:21 +0930 Message-ID: <87ehb01kdy.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 619 Lines: 16 Wedson Almeida Filho writes: > The subtraction is removed at the expense of generality: when the element size > is 1, the array length cannot exceed half the architecture's addressable > memory. People do copy code, so I prefer to set the best example possible. Unless it's a useful optimization, I think it should stay the way it is. Cheers, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/