emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matching regex case-sensitively in C strings?


From: Mattias Engdegård
Subject: Re: Matching regex case-sensitively in C strings?
Date: Wed, 9 Nov 2022 11:33:09 +0100

8 nov. 2022 kl. 20.37 skrev Eli Zaretskii <eliz@gnu.org>:

> Please don't call this "translate_table", as it isn't.  The
> documentation elsewhere calls this "canonicalize_table" or just
> "canonicalize".

Agreed.

>> fast_c_string_match_ignore_case (Lisp_Object regexp,
>>                               const char *string, ptrdiff_t len)
>> {
>> +  return fast_c_string_match (regexp, string, len, true);
>> +}
> 
> I'm bothered that this function, which is supposed to be fast, will
> now be slower due to an extra function call.

You are right to worry about it, but there is actually no need for concern 
here: it's a tail call (and the extra argument is last) so it should compile to 
an unconditional jump (and setting a register). You would be hard-pressed to 
measure the "cost" even if you looked at cycle counters.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]