All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] grep: avoid using oid_to_hex() with parse_object_or_die()
Date: Tue, 28 Jul 2020 19:35:50 -0300	[thread overview]
Message-ID: <CAHd-oW68nGch8b3tfas4AUUgA8so-ihwazAf8-W-xQNPi31=Mw@mail.gmail.com> (raw)
In-Reply-To: <551da4ae-c75a-0f2b-7786-2fee32939b2b@web.de>

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>

  reply	other threads:[~2020-07-28 22:36 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 [this message]
2020-07-28 22:44   ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to='CAHd-oW68nGch8b3tfas4AUUgA8so-ihwazAf8-W-xQNPi31=Mw@mail.gmail.com' \
    --to=matheus.bernardino@usp.br \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.