Fdelete speed tweak for strings

* src/fns.c (Fdelete): Hoist FIXNUMP out of a loop,
and turn it into CHARACTERP.
This commit is contained in:
Paul Eggert 2020-08-15 10:48:37 -07:00
parent f1b06fd5fc
commit e97def2bbc

View file

@ -1766,6 +1766,9 @@ changing the value of a sequence `foo'. */)
}
else if (STRINGP (seq))
{
if (!CHARACTERP (elt))
return seq;
ptrdiff_t i, ibyte, nchars, nbytes, cbytes;
int c;
@ -1784,7 +1787,7 @@ changing the value of a sequence `foo'. */)
cbytes = 1;
}
if (!FIXNUMP (elt) || c != XFIXNUM (elt))
if (c != XFIXNUM (elt))
{
++nchars;
nbytes += cbytes;
@ -1814,7 +1817,7 @@ changing the value of a sequence `foo'. */)
cbytes = 1;
}
if (!FIXNUMP (elt) || c != XFIXNUM (elt))
if (c != XFIXNUM (elt))
{
unsigned char *from = SDATA (seq) + ibyte;
unsigned char *to = SDATA (tem) + nbytes;