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

Re: [PATCH] utf8: use skip_iprefix() in same_utf_encoding()

From
Jeff King <peff@peff.net>
Date
Nov 8, 2019, 22:20 UTC
Message-ID
<20191108222048.GA18554@sigill.intra.peff.net>
In-Reply-To
<b27cc95d-8cb8-db49-c2d1-3eb591624000@web.de>
On Fri, Nov 08, 2019 at 09:25:21PM +0100, René Scharfe wrote:
> Get rid of magic numbers by using skip_iprefix() and skip_prefix() for
> parsing the leading "[uU][tT][fF]-?" of both strings instead of checking
> with istarts_with() and an explicit comparison.

Yeah, I think the result is much easier to understand. I didn't look closely at it, but the generated asm seems to be slightly shorter, too.

-Peff
Previous: René Scharfe
Message 2 of 2 in “utf8: use skip_iprefix() in same_utf_encoding()”
  1. utf8: use skip_iprefix() in same_utf_encoding()René Scharfe, Nov 8, 2019
  2. Jeff KingNov 8, 2019

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.