diff options
author | Simen Heggestøyl <simenheg@gmail.com> | 2016-09-09 18:46:55 +0200 |
---|---|---|
committer | Simen Heggestøyl <simenheg@gmail.com> | 2016-09-09 18:46:55 +0200 |
commit | 367f8568bc9e759ebdfb423648891efa0346456b (patch) | |
tree | 53af7a92fcac725150fe6fce916b27c9e0153473 /lisp | |
parent | 8634efa38179f44c2cb5c52c25ced3f02fa5ec1a (diff) |
* lisp/emacs-lisp/ring.el: Use lexical-binding
* lisp/emacs-lisp/ring.el (ring-elements): Don't use the RESULT
argument of `dotimes' when the iteration variable isn't referred by
it.
(ring-member): Don't pass nil as the RESULT argument of `dotimes'
since it's the default.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emacs-lisp/ring.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el index b1b66262d4..c6684ec949 100644 --- a/lisp/emacs-lisp/ring.el +++ b/lisp/emacs-lisp/ring.el @@ -1,4 +1,4 @@ -;;; ring.el --- handle rings of items +;;; ring.el --- handle rings of items -*- lexical-binding: t; -*- ;; Copyright (C) 1992, 2001-2016 Free Software Foundation, Inc. @@ -160,14 +160,15 @@ will be performed." (size (ring-size ring)) (vect (cddr ring)) lst) - (dotimes (var (cadr ring) lst) - (push (aref vect (mod (+ start var) size)) lst)))) + (dotimes (var (cadr ring)) + (push (aref vect (mod (+ start var) size)) lst)) + lst)) (defun ring-member (ring item) "Return index of ITEM if on RING, else nil. Comparison is done via `equal'. The index is 0-based." (catch 'found - (dotimes (ind (ring-length ring) nil) + (dotimes (ind (ring-length ring)) (when (equal item (ring-ref ring ind)) (throw 'found ind))))) |