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

Re: [PATCH] urlmatch: use hex2chr() in append_normalized_escapes()

From
René Scharfe <l.s.r@web.de>
Date
Jul 8, 2017, 15:15 UTC
Message-ID
<46294b4f-5e6d-bbf3-8b93-9d23df5ce07b@web.de>
In-Reply-To
<A1589486-3E84-494C-9B8D-3FB1724B3145@gmail.com>
Am 08.07.2017 um 16:28 schrieb Kyle J. McKay:
Show 13 quoted lines
> On Jul 8, 2017, at 01:59, René Scharfe wrote:
> 
>> Simplify the code by using hex2chr() to convert and check for invalid
>> characters at the same time instead of doing that sequentially with
>> one table lookup for each.
> 
> I think that comment may be a bit misleading as the changes are just
> switching from one set of inlines to another.  Essentially the same
> sequential check takes place in the hex2chr inlined function which is
> being used to replace the "one table lookup for each".  An optimizing
> compiler will likely eliminate any difference between the before and
> after patch versions.  Nothing immediately comes to mind as an alternate
> comment though, so I'm not proposing any changes to the comment.

Right, the table lookups for isxdigit and hexval are not duplicated when compiling with -O2.

René
Previous: Kyle J. McKay
Message 3 of 3 in “urlmatch: use hex2chr() in append_normalized_escapes()”
  1. urlmatch: use hex2chr() in append_normalized_escapes()René Scharfe, Jul 8, 2017
  2. Kyle J. McKayJul 8, 2017
  3. René ScharfeJul 8, 2017

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.