bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#17814: 24.3.91; better string manipulation in subr-x


From: Shigeru Fukaya
Subject: bug#17814: 24.3.91; better string manipulation in subr-x
Date: Fri, 20 Jun 2014 04:10:30 +0900

Some string manipulation functions in subr-x have room to optimize.


string-trim-left, string-trim-right -- use `substring' and
`match-beginning/end' instead of `replace-match'.  The formers have
bytecodes and the latter not.

string-trim -- call string-trim-left first would be cost effective.
But, to change the code to trim both sides of the string at once might
be better.

string-remove-suffix -- change the last argument of substring will
shorten the code.


I change the string-trim defined using defun from defsubst, as its
string literal is somewhat big (Actually I suspect most of other
functions would also be better if defined by defun).


Regards,
Shigeru

Attachment: subr-x.diff
Description: Binary data


reply via email to

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