Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbbF3XwV (ORCPT ); Tue, 30 Jun 2015 19:52:21 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:32800 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbbF3XwM (ORCPT ); Tue, 30 Jun 2015 19:52:12 -0400 MIME-Version: 1.0 In-Reply-To: <20150628164403.GA7169@p183.telecom.by> References: <20150628163252.GA1991@p183.telecom.by> <20150628164403.GA7169@p183.telecom.by> Date: Tue, 30 Jun 2015 18:52:11 -0500 X-Google-Sender-Auth: _F2v5-qbgWVexfSlRmENjK1Ba6w Message-ID: Subject: Re: [PATCH] un-improve strrchr() From: Chris Rorvick To: Alexey Dobriyan Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 764 Lines: 20 [ resending w/o HTML formatting ] On Sun, Jun 28, 2015 at 11:44 AM, Alexey Dobriyan wrote: > Previous code did 1 branch per character + 1 branch for every character > in the last path component. Current code does 2 branches per characher > regardless. Shouldn't that be "+ 2 branches for every character in the last path component"? The structure of the loop is basically the same; you're just performing fewer iterations if the character is found when searching from the end. Regards, Chris -- 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/