From patchwork Mon Sep 24 10:06:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phillip Wood X-Patchwork-Id: 10612147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 910F91803 for ; Mon, 24 Sep 2018 10:06:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79E0928B3D for ; Mon, 24 Sep 2018 10:06:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E36629BC4; Mon, 24 Sep 2018 10:06:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E467229BC9 for ; Mon, 24 Sep 2018 10:06:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbeIXQHm (ORCPT ); Mon, 24 Sep 2018 12:07:42 -0400 Received: from smtp-out-2.talktalk.net ([62.24.135.66]:51361 "EHLO smtp-out-2.talktalk.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728279AbeIXQHk (ORCPT ); Mon, 24 Sep 2018 12:07:40 -0400 Received: from lindisfarne.localdomain ([92.28.142.68]) by smtp.talktalk.net with SMTP id 4NkrgLWW7VlGZ4NkzgJ4su; Mon, 24 Sep 2018 11:06:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=talktalk.net; s=cmr1711; t=1537783582; bh=WUDfebNobvVfgzl7CmJxqgHRH6qyNOAMalxpXTn4dJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To; b=JoAD4KgG5CSU/ULR7Tb9vsbD3RzwTIxTHZHfX9CHY9crkqVyvUTL5g9SgY1fp6Ups gdBdr/YhKMPuIquKOmfYmhDBqdNTWhjbfHrH/2FyrFFk8ZztFGBRA1ifnyqg2VbbuW MStSm+0vvtpD/2p3MNTgOHcnLr8kLdy45jRMIVSA= X-Originating-IP: [92.28.142.68] X-Spam: 0 X-OAuthority: v=2.3 cv=JcuSU3CV c=1 sm=1 tr=0 a=UGDAwvN9cmeZh0o4udnnNw==:117 a=UGDAwvN9cmeZh0o4udnnNw==:17 a=evINK-nbAAAA:8 a=30r_6wDvDLaDDSgIxuMA:9 a=99yrcnEXu3fBX6qS:21 a=2psp2rGW2c9tThR_:21 a=RfR_gqz1fSpA9VikTjo0:22 From: Phillip Wood To: Git Mailing List Cc: Stefan Beller , Phillip Wood Subject: [RFC PATCH 2/3] diff.c: remove unused variables Date: Mon, 24 Sep 2018 11:06:03 +0100 Message-Id: <20180924100604.32208-3-phillip.wood@talktalk.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924100604.32208-1-phillip.wood@talktalk.net> References: <20180924100604.32208-1-phillip.wood@talktalk.net> MIME-Version: 1.0 Reply-To: Phillip Wood X-CMAE-Envelope: MS4wfFQw2RXYyzMW0EfUXpufrwp8z+4Aj+3RRUwG3LNInHNHYVSQU3Gy4z+TJm3EqUFf2jnDtBfNV6YjTEoWzuwtYGirpPg/jP84VXk2wthEwqkgF3SgYEp1 pBtT9LPSl9YWvPOX7ZYKOb5RqtxL/VPdu7yagl30P2BKBl8DCB7FkVI7rHdH42qVcoee7x6i2my0kcvbmXndEOhSgd8rHB598PsKk7BxDK9xlQ7i4YsBTx+Z sOa7XKNZKgEr/VawxC/iEQ== Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Phillip Wood The string lengths are not used in cmp_in_block_with_wsd() so lets remove them. Signed-off-by: Phillip Wood --- diff.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/diff.c b/diff.c index 9393993e33..0a652e28d4 100644 --- a/diff.c +++ b/diff.c @@ -789,7 +789,6 @@ static int cmp_in_block_with_wsd(const struct diff_options *o, int n) { struct emitted_diff_symbol *l = &o->emitted_symbols->buf[n]; - int al = cur->es->len, cl = l->len; const char *a = cur->es->line, *b = match->es->line, *c = l->line; @@ -823,13 +822,10 @@ static int cmp_in_block_with_wsd(const struct diff_options *o, */ wslen = strlen(pmb->wsd->string); - if (pmb->wsd->current_longer) { + if (pmb->wsd->current_longer) c += wslen; - cl -= wslen; - } else { + else a += wslen; - al -= wslen; - } if (strcmp(a, c)) return 1;