aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2020-08-15 10:48:37 -0700
committerPaul Eggert2020-08-15 11:19:51 -0700
commite97def2bbce7777d3afc916a5aa4d951fab5f3f4 (patch)
tree7fe9ccffbea437d39e56da8c5023d9f106d8c7be /src
parentf1b06fd5fc66377f85b420d3d40c666da9dca2a5 (diff)
downloademacs-e97def2bbce7777d3afc916a5aa4d951fab5f3f4.tar.gz
emacs-e97def2bbce7777d3afc916a5aa4d951fab5f3f4.zip
Fdelete speed tweak for strings
* src/fns.c (Fdelete): Hoist FIXNUMP out of a loop, and turn it into CHARACTERP.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index ded6f344aad..c89bd8144e7 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1766,6 +1766,9 @@ changing the value of a sequence `foo'. */)
1766 } 1766 }
1767 else if (STRINGP (seq)) 1767 else if (STRINGP (seq))
1768 { 1768 {
1769 if (!CHARACTERP (elt))
1770 return seq;
1771
1769 ptrdiff_t i, ibyte, nchars, nbytes, cbytes; 1772 ptrdiff_t i, ibyte, nchars, nbytes, cbytes;
1770 int c; 1773 int c;
1771 1774
@@ -1784,7 +1787,7 @@ changing the value of a sequence `foo'. */)
1784 cbytes = 1; 1787 cbytes = 1;
1785 } 1788 }
1786 1789
1787 if (!FIXNUMP (elt) || c != XFIXNUM (elt)) 1790 if (c != XFIXNUM (elt))
1788 { 1791 {
1789 ++nchars; 1792 ++nchars;
1790 nbytes += cbytes; 1793 nbytes += cbytes;
@@ -1814,7 +1817,7 @@ changing the value of a sequence `foo'. */)
1814 cbytes = 1; 1817 cbytes = 1;
1815 } 1818 }
1816 1819
1817 if (!FIXNUMP (elt) || c != XFIXNUM (elt)) 1820 if (c != XFIXNUM (elt))
1818 { 1821 {
1819 unsigned char *from = SDATA (seq) + ibyte; 1822 unsigned char *from = SDATA (seq) + ibyte;
1820 unsigned char *to = SDATA (tem) + nbytes; 1823 unsigned char *to = SDATA (tem) + nbytes;