unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* why is reverse a string in-place so much slower than a vector?
@ 2014-04-25  8:12 Leo Liu
  2014-04-25  8:17 ` Leo Liu
  0 siblings, 1 reply; 7+ messages in thread
From: Leo Liu @ 2014-04-25  8:12 UTC (permalink / raw)
  To: emacs-devel


(defun rev (a)
  (let ((l (length a)))
    (dotimes (i (floor l 2) a)
      (cl-rotatef (aref a i) (aref a (1- (- l i)))))))

-- 
Sent from my Emacs




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-26  0:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-25  8:12 why is reverse a string in-place so much slower than a vector? Leo Liu
2014-04-25  8:17 ` Leo Liu
2014-04-25  8:55   ` Rüdiger Sonderfeld
2014-04-25  9:14   ` Andreas Schwab
2014-04-25  9:35     ` Leo Liu
2014-04-25 11:00       ` Andreas Schwab
2014-04-26  0:19         ` Leo Liu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).