Re: [PATCH] pack-objects: use strcspn(3) in name_cmp_len()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes:

> I wonder if this name_cmp_len() is worth keeping at all. If all we're
> doing is wrapping strcspn() (which b.t.w, seem to be less "open-coding"
> and just that it wasn't known to the original author in 5d4a6003354
> (Make git-pack-objects a builtin, 2006-08-03)), then just inlining that
> in the two name_cmp_len() invocations would be better, or maybe:

Even if the stop candidate bytes were a constant, or if there were
only a single callsite, I am not sure if it is a good idea, simply
because with this

> 	strcspn(..., object_reject);

or with a literal "\n/" to make it easier to see where in the string
we are stopping, it is hard without named function to tell what
length we are computing.

The function being file-scope static, decent compilers hopefully
would inline the calls by two callers.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux