GNU bug report logs - #17814
24.3.91; better string manipulation in subr-x

Previous Next

Package: emacs;

Reported by: Shigeru Fukaya <shigeru.fukaya <at> gmail.com>

Date: Thu, 19 Jun 2014 19:12:01 UTC

Severity: wishlist

Found in version 24.3.91

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Shigeru Fukaya <shigeru.fukaya <at> gmail.com>
To: 17814 <at> debbugs.gnu.org
Subject: bug#17814: 24.3.91; better string manipulation in subr-x
Date: Fri, 20 Jun 2014 04:10:30 +0900
[Message part 1 (text/plain, inline)]
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
[subr-x.diff (application/octet-stream, attachment)]

This bug report was last modified 6 years and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.