[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [PATCH v2] C: use skip-prefix to avoid hardcoded string length
From:       Junio C Hamano <gitster () pobox ! com>
Date:       2020-01-31 21:03:28
Message-ID: xmqq36bv9w4f.fsf () gitster-ct ! c ! googlers ! com
[Download RAW message or body]

Andrei Rybak <rybak.a.v@gmail.com> writes:

> On 1/30/20 8:35 PM, Junio C Hamano wrote:
>> We often skip an optional prefix in a string with a hardcoded
>> constant, e.g.
>>
>>       if (starts_with(string, "prefix"))
>>               string += 6;
>>
>> which is less error prone when written
>>
>>       skip_prefix(string, "prefix", &string);
>
> Should the subject line say "skip_prefix" with an underscore instead of
> "skip-prefix" with a dash?

Perhaps.  Or "skip_prefix()" to clarify that we are talking about a
function.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic