Thread (1 message) 1 message, 1 author, 2016-06-16

Re: [PATCH 2/2] bisect: rewrite `check_term_format` shell function in C

From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:10

Johannes Schindelin [off-list ref] writes:
Maybe something like instead?

	static int one_of(const char *term, ...)
	{
		int res = 0;
		va_list matches;
		const char *match;

		va_start(matches, term);
		while (!res && (match = va_arg(matches, const char *)))
			res = !strcmp(term, match);
		va_end(matches);

		return res;
	}
Ciao,
Dscho
This looks good (even though we try to avoid assignment in
conditionals as much as possible).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help