D943: chg: move only first time relevant if condition out of loop

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Oct 5 09:55:16 EDT 2017


yuja added subscribers: quark, yuja.
yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  I prefer the original code since it looks simpler and there wouldn't be
  measurable performance win.
  
  @quark which do you like?

INLINE COMMENTS

> chg.c:388
>  			break;
> -		if (i == 0 && strcmp("serve", argv[i]) == 0)
> -			state |= SERVE;
> -		else if (strcmp("-d", argv[i]) == 0 ||
> -			 strcmp("--daemon", argv[i]) == 0)
> +		if (strcmp("-d", argv[i]) == 0 || strcmp("--daemon", argv[i]) == 0)
>  			state |= DAEMON;

Nit: this line is over 80 chars.

REPOSITORY
  rHG Mercurial

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

To: singhsrb, #hg-reviewers, yuja
Cc: yuja, quark, mercurial-devel


More information about the Mercurial-devel mailing list