Skip to content

Commit 1362849

Browse files
committed
Use seq-mapcat instead of apply 'nonc and mapcar
1 parent b2d9cca commit 1362849

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

swift-mode-imenu.el

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -377,21 +377,19 @@ and \"c\".
377377
"Convert list of DECLARATIONS to alist for `imenu--index-alist'.
378378
379379
Declarations are organized as trees."
380-
(apply
381-
'nconc
382-
(mapcar
383-
(lambda (declaration)
384-
(let* ((name-token (swift-mode:declaration:name-token declaration))
385-
(name (swift-mode:token:text name-token))
386-
(position (swift-mode:token:start name-token))
387-
(children (swift-mode:declaration:children declaration)))
388-
(cons
389-
(cons name position)
390-
(mapcar
391-
(lambda (pair)
392-
(cons (concat name "." (car pair)) (cdr pair)))
393-
(swift-mode:format-for-imenu:flat children)))))
394-
declarations)))
380+
(seq-mapcat
381+
(lambda (declaration)
382+
(let* ((name-token (swift-mode:declaration:name-token declaration))
383+
(name (swift-mode:token:text name-token))
384+
(position (swift-mode:token:start name-token))
385+
(children (swift-mode:declaration:children declaration)))
386+
(cons
387+
(cons name position)
388+
(mapcar
389+
(lambda (pair)
390+
(cons (concat name "." (car pair)) (cdr pair)))
391+
(swift-mode:format-for-imenu:flat children)))))
392+
declarations))
395393

396394
(defun swift-mode:format-for-imenu:nested (declarations)
397395
"Convert list of DECLARATIONS to alist for `imenu--index-alist'.

0 commit comments

Comments
 (0)