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

Jun Wu quark at fb.com
Wed Feb 24 13:38:25 EST 2016


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".


More information about the Mercurial-devel mailing list