GNU bug report logs - #36441
26.2.90; Simplify dom-texts

Previous Next

Package: emacs;

Reported by: Xu Chunyang <mail <at> xuchunyang.me>

Date: Sun, 30 Jun 2019 04:31:02 UTC

Severity: minor

Tags: fixed

Found in version 26.2.90

Fixed in version 27.1

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

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xu Chunyang <mail <at> xuchunyang.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.2.90; Simplify dom-texts
Date: Sun, 30 Jun 2019 12:30:22 +0800
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




This bug report was last modified 5 years and 324 days ago.

Previous Next


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