From patchwork Wed Mar 20 08:16:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 10861005 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 7BEF31708 for ; Wed, 20 Mar 2019 08:16:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65B7728C20 for ; Wed, 20 Mar 2019 08:16:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A75B29A92; Wed, 20 Mar 2019 08:16:46 +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=-7.9 required=2.0 tests=BAYES_00,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 0530A28C20 for ; Wed, 20 Mar 2019 08:16:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbfCTIQp (ORCPT ); Wed, 20 Mar 2019 04:16:45 -0400 Received: from cloud.peff.net ([104.130.231.41]:57456 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726686AbfCTIQo (ORCPT ); Wed, 20 Mar 2019 04:16:44 -0400 Received: (qmail 19702 invoked by uid 109); 20 Mar 2019 08:16:44 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Wed, 20 Mar 2019 08:16:44 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 6406 invoked by uid 111); 20 Mar 2019 08:17:06 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Wed, 20 Mar 2019 04:17:06 -0400 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Wed, 20 Mar 2019 04:16:42 -0400 Date: Wed, 20 Mar 2019 04:16:42 -0400 From: Jeff King To: git@vger.kernel.org Subject: [PATCH 12/13] pretty: drop unused strbuf from parse_padding_placeholder() Message-ID: <20190320081642.GL10403@sigill.intra.peff.net> References: <20190320081258.GA5621@sigill.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190320081258.GA5621@sigill.intra.peff.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlike other parts of the --pretty user-format expansion, this function is not actually writing to the output, but instead just storing the padding values into a context struct. We don't need to be passed a strbuf at all. Signed-off-by: Jeff King --- pretty.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pretty.c b/pretty.c index f925a014f9..ced0485257 100644 --- a/pretty.c +++ b/pretty.c @@ -988,8 +988,7 @@ static size_t parse_color(struct strbuf *sb, /* in UTF-8 */ return rest - placeholder; } -static size_t parse_padding_placeholder(struct strbuf *sb, - const char *placeholder, +static size_t parse_padding_placeholder(const char *placeholder, struct format_commit_context *c) { const char *ch = placeholder; @@ -1194,7 +1193,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ case '<': case '>': - return parse_padding_placeholder(sb, placeholder, c); + return parse_padding_placeholder(placeholder, c); } /* these depend on the commit */