singhsrb added a comment.

  @simpkins I definitely prefer
  
    int i;
    for (i = 0; i < argc; ++i) {
            if (strcmp(argv[i], "--") == 0) {
                    break;
            } else if (strcmp("-d", argv[i]) == 0 ||
                strcmp("--daemon", argv[i]) == 0) {
                    if (strcmp("serve", argv[0]) == 0)
                            return 1;
            } else if (strcmp("--time", argv[i]) == 0) {
                    return 1;
            }
    }
    return 0;
  
  as it avoids the need to check for "--serve" if we never saw "--daemon". 
Also, avoids the early return in the second option. I did not notice that we 
were only checking for the SERVEDAEMON and hence, this was also an option :).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D943

To: singhsrb, #hg-reviewers, yuja
Cc: simpkins, yuja, quark, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to