Re: [PATCH 1/4] remote: use skip_prefix

2016-02-15 Thread Thomas Gummerer
On 02/15, Jeff King wrote: > On Mon, Feb 15, 2016 at 06:42:27PM +0100, Thomas Gummerer wrote: > > > 95b567c7 ("use skip_prefix to avoid repeating strings") transformed > > calls using starts_with() and then skipping the length of the prefix to > > skip_prefix() calls. In remote.c there are a few

Re: [PATCH 1/4] remote: use skip_prefix

2016-02-15 Thread Jeff King
On Mon, Feb 15, 2016 at 01:35:03PM -0500, Eric Sunshine wrote: > On Mon, Feb 15, 2016 at 1:18 PM, Jeff King wrote: > > This is definitely an improvement, but I think we can actually go a step > > further here, and use parse_config_key. Like: > > > > - if (starts_with(key,

Re: [PATCH 1/4] remote: use skip_prefix

2016-02-15 Thread Eric Sunshine
On Mon, Feb 15, 2016 at 1:18 PM, Jeff King wrote: > This is definitely an improvement, but I think we can actually go a step > further here, and use parse_config_key. Like: > > - if (starts_with(key, "branch.")) { > - name = key + 7; > - subkey =

Re: [PATCH 1/4] remote: use skip_prefix

2016-02-15 Thread Jeff King
On Mon, Feb 15, 2016 at 06:42:27PM +0100, Thomas Gummerer wrote: > 95b567c7 ("use skip_prefix to avoid repeating strings") transformed > calls using starts_with() and then skipping the length of the prefix to > skip_prefix() calls. In remote.c there are a few calls like: > > if

[PATCH 1/4] remote: use skip_prefix

2016-02-15 Thread Thomas Gummerer
95b567c7 ("use skip_prefix to avoid repeating strings") transformed calls using starts_with() and then skipping the length of the prefix to skip_prefix() calls. In remote.c there are a few calls like: if (starts_with(foo, "bar")) foo += 3 These calls weren't touched by the commit