unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36441: 26.2.90; Simplify dom-texts
@ 2019-06-30  4:30 Xu Chunyang
  2019-07-06 18:43 ` Noam Postavsky
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Chunyang @ 2019-06-30  4:30 UTC (permalink / raw)
  To: 36441

In the dom-texts function

  (mapconcat 'identity (mapcar ...) ...)

can be simplified

  (mapconcat ...)


diff -u --label /Users/xcy/src/emacs-mac/lisp/dom.el --label \#\<buffer\ dom.el\> /Users/xcy/src/emacs-mac/lisp/dom.el /var/folders/7f/s191h4q97p90374yw15ssrs00000gn/T/buffer-content-jql2ad
--- /Users/xcy/src/emacs-mac/lisp/dom.el
+++ #<buffer dom.el>
@@ -79,13 +79,11 @@
 (defun dom-texts (node &optional separator)
   "Return all textual data under NODE concatenated with SEPARATOR in-between."
   (mapconcat
-   'identity
-   (mapcar
-    (lambda (elem)
-      (if (stringp elem)
-	  elem
-	(dom-texts elem separator)))
-    (dom-children node))
+   (lambda (elem)
+     (if (stringp elem)
+         elem
+       (dom-texts elem separator)))
+   (dom-children node)
    (or separator " ")))
 
 (defun dom-child-by-tag (dom tag)

Diff finished.  Sun Jun 30 12:23:43 2019





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

end of thread, other threads:[~2019-07-06 18:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-30  4:30 bug#36441: 26.2.90; Simplify dom-texts Xu Chunyang
2019-07-06 18:43 ` Noam Postavsky

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).