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:
parent
f1b06fd5fc
commit
e97def2bbc
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue