[PATCH 1 of 3] chg: extract gethgcmd logic to a function

Sean Farley sean at farley.io
Wed Feb 24 13:51:46 EST 2016


Jun Wu <quark at fb.com> writes:

> On 02/24/2016 06:24 PM, Sean Farley wrote:
>> Did you mean to change this to static?
>
> I don't quite get it but do you mean the following change?
>
>   static const char *gethgcmd(void)
>   {
> -  static const char *hgcmd;
> +  const char *hgcmd;
>
> "hgcmd" is static intensionally. So we can skip getenv() (expensive)
> when calling gethgcmd() the 2nd time. It's like "@util.cachefunc".

Righto, I got that part. I just wanted to make sure it was intentional
:-) These patches are fine by me, then.


More information about the Mercurial-devel mailing list