git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/7] Remove ranges from switch statements.

From
Junio C Hamano <junkio@cox.net>
Date
Jun 18, 2006, 21:07 UTC
Message-ID
<7vveqyyxyj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1150643889264-git-send-email-octo@verplant.org>
Florian Forster <octo@verplant.org> writes:
Show 7 quoted lines
> -	switch (ch) {
> -	case '/': case '-': case '.':
> -	case 'A'...'Z':	case 'a'...'z':	case '0'...'9':
> +	if (((ch >= 'A') && (ch <= 'Z'))
> +			|| ((ch >= 'a') && (ch <= 'z'))
> +			|| ((ch >= '0') && (ch <= '9'))
> + ...
Sorry for bringing up an old topic again, but wouldn't people
agree that this is easier to read if it were written this way ;-)?
 
	if (	   (('A' <= ch) && (ch <= 'Z'))
        	|| (('a' <= ch) && (ch <= 'z'))
		|| (('0' <= ch) && (ch <= '9'))
	...
Previous: Florian ForsterNext: Timo Hirvonen
Message 3 of 4 in “Remove ranges from switch statements.”
  1. 1/7 Remove ranges from switch statements.Florian Forster, Jun 18, 2006
  2. 2/7 Initialize FAMs using `FLEX_ARRAY'.Florian Forster, Jun 18, 2006
  3. Junio C HamanoJun 18, 2006
  4. Timo HirvonenJun 18, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.