Re: [PATCH v2] connect.c: remove a few globals by using git_config callback data

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

 



Thanks for the feedback.

On Wed, Mar 11, 2009 at 12:52 PM, Johannes Schindelin
<Johannes.Schindelin@xxxxxx> wrote:
>> @@ -383,6 +381,8 @@ static int git_proxy_command_options(const char *var, const char *value,
>>               const char *for_pos;
>>               int matchlen = -1;
>>               int hostlen;
>> +             const char *rhost_name = cb;
>> +             int rhost_len = strlen(rhost_name);
>
> I see that you still calculate the length everytime
> git_proxy_command_options() is called -- which is for every config
> variable.

Actually, the length-calculation is now moved inside the check for
"core.gitproxy", so it should only trigger for each config variable
that is "core.gitproxy". Hopefully, this should usually be just once
;)

This change was suggested as a compromise by Junio.

>
>> +     git_config(git_proxy_command_options, (void*)host);
>
> The (void *) should not be needed.

Actually, it is - it casts away the const-ness of the string. Removing
the cast generates a warning on my installation of GCC. Perhaps I
should have made that clearer by casting to "char*" instead of
"void*"?

-- 
Erik "kusma" Faye-Lund
kusmabite@xxxxxxxxx
(+47) 986 59 656
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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