Re: [PATCH v4 3/4] sha1_name: parse less while finding common prefix

2017-10-09 Thread Jeff King
On Sun, Oct 08, 2017 at 02:49:41PM -0400, Derrick Stolee wrote: > +static inline char get_hex_char_from_oid(const struct object_id *oid, > + int pos) > +{ > + static const char hex[] = "0123456789abcdef"; > + > + if ((pos & 1) == 0) > +

[PATCH v4 3/4] sha1_name: parse less while finding common prefix

2017-10-08 Thread Derrick Stolee
Create get_hex_char_from_oid() to parse oids one hex character at a time. This prevents unnecessary copying of hex characters in extend_abbrev_len() when finding the length of a common prefix. Signed-off-by: Derrick Stolee --- sha1_name.c | 14 -- 1 file