From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id E5F4E1FF72 for ; Thu, 19 Oct 2017 05:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751375AbdJSFcs (ORCPT ); Thu, 19 Oct 2017 01:32:48 -0400 Received: from cloud.peff.net ([104.130.231.41]:57292 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751054AbdJSFcs (ORCPT ); Thu, 19 Oct 2017 01:32:48 -0400 Received: (qmail 2193 invoked by uid 109); 19 Oct 2017 05:32:48 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Thu, 19 Oct 2017 05:32:48 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 6374 invoked by uid 111); 19 Oct 2017 05:32:52 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with SMTP; Thu, 19 Oct 2017 01:32:52 -0400 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 19 Oct 2017 01:32:45 -0400 Date: Thu, 19 Oct 2017 01:32:45 -0400 From: Jeff King To: Junio C Hamano Cc: Stefan Beller , git@vger.kernel.org, orgads@gmail.com Subject: Re: [PATCH] diff.c: increment buffer pointer in all code path Message-ID: <20171019053245.g4n32ebnyi4xmbwi@sigill.intra.peff.net> References: <20171012200536.m6oz4zrjcze3yw4i@sigill.intra.peff.net> <20171012233322.31203-1-sbeller@google.com> <20171013001837.43nx5paeqisbrflq@sigill.intra.peff.net> <20171013002057.froqi54olmhmah6b@sigill.intra.peff.net> <20171019050459.p2cx63yrxfwq4ta3@sigill.intra.peff.net> <20171019052457.gqenoshgyjcw53tb@sigill.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Oct 19, 2017 at 02:32:04PM +0900, Junio C Hamano wrote: > > Yeah I am not sure if I like this comparison at the beginning of the > > function: > > > > static int next_byte(const char **cp, const char **endp, > > const struct diff_options *diffopt) > > { > > int retval; > > > > if (*cp > *endp) > > return -1; > > > > but it says endp _is_ part of valid input, contrary to my intuition. > > > > And your change to the initialization of ae/be in moved_entry_cmp() > > makes it consistent with it, I think. > > > > But doesn't it mean ae computation in get_string_hash() also needs a > > massaging? > > Ah, forget the last two lines. You do do the massaging in your > patch. I was just replying so. :) > My preference actually is to fix next_byte to follow the usual "when > we end, it points one past the valid region", though. Yeah, I think that is my preference, too. -Peff