git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
Cc: "René Scharfe" <l.s.r@web.de>, "Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH] grep: avoid using oid_to_hex() with parse_object_or_die()
Date: Tue, 28 Jul 2020 15:44:03 -0700	[thread overview]
Message-ID: <xmqq1rkvclak.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <CAHd-oW68nGch8b3tfas4AUUgA8so-ihwazAf8-W-xQNPi31=Mw@mail.gmail.com> (Matheus Tavares Bernardino's message of "Tue, 28 Jul 2020 19:35:50 -0300")

Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:

> On Tue, Jul 28, 2020 at 6:40 PM René Scharfe <l.s.r@web.de> wrote:
>>
>> parse_object_or_die() is passed an object ID and a name to show if the
>> object cannot be parsed.  If the name is NULL then it shows the
>> hexadecimal object ID.  Use that feature instead of preparing and
>> passing the hexadecimal representation to the function proactively.
>> That's shorter and a bit more efficient.
>>
>> Signed-off-by: René Scharfe <l.s.r@web.de>
>
> Good catch. And this seems to be the only place where we use
> `parse_object_or_die(oid, oid_to_hex(oid))`.
>
> Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>

Yup, makes sense.  Thanks, both.

      reply	other threads:[~2020-07-28 22:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 21:40 [PATCH] grep: avoid using oid_to_hex() with parse_object_or_die() René Scharfe
2020-07-28 22:35 ` Matheus Tavares Bernardino
2020-07-28 22:44   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1rkvclak.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=matheus.bernardino@usp.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).