Re: [PATCH] grep: avoid using oid_to_hex() with parse_object_or_die()
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- Jul 28, 2020, 22:35 UTC
- Message-ID
- <CAHd-oW68nGch8b3tfas4AUUgA8so-ihwazAf8-W-xQNPi31=Mw@mail.gmail.com>
- 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:
Show 8 quoted lines
> > 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>