From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#18175: files.el: use mapc in (mapcar 'switch-to-buffer ...) Date: Sat, 2 Aug 2014 17:55:53 -0700 (PDT) Message-ID: <3d8bb179-4e59-4d81-9ee1-54ff0da430b0@default> References: <87r40yftes.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407027456 11473 80.91.229.3 (3 Aug 2014 00:57:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Aug 2014 00:57:36 +0000 (UTC) To: Ivan Shmakov , 18175@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 03 02:57:28 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XDk74-0006Lf-5R for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Aug 2014 02:57:26 +0200 Original-Received: from localhost ([::1]:46324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDk73-0005M6-NB for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Aug 2014 20:57:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDk6s-0005Lg-Nc for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 20:57:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDk6h-0003Jr-Kn for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 20:57:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDk6h-0003Je-H8 for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 20:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XDk6g-0007n9-Nt for bug-gnu-emacs@gnu.org; Sat, 02 Aug 2014 20:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Aug 2014 00:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18175 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18175-submit@debbugs.gnu.org id=B18175.140702736429795 (code B ref 18175); Sun, 03 Aug 2014 00:57:02 +0000 Original-Received: (at 18175) by debbugs.gnu.org; 3 Aug 2014 00:56:04 +0000 Original-Received: from localhost ([127.0.0.1]:55347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XDk5k-0007kU-1E for submit@debbugs.gnu.org; Sat, 02 Aug 2014 20:56:04 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:44520) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XDk5g-0007jj-Se for 18175@debbugs.gnu.org; Sat, 02 Aug 2014 20:56:02 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s730trRI028617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 3 Aug 2014 00:55:54 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s730tqFH025349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Aug 2014 00:55:53 GMT Original-Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s730tp9a017898; Sun, 3 Aug 2014 00:55:51 GMT In-Reply-To: <87r40yftes.fsf@violet.siamics.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92065 Archived-At: > =09Given that switch-to-buffer returns its argument, /and/ given > =09that mapc returns the sequence it=E2=80=99s given, I suggest that the > =09(mapcar 'switch-to-buffer LIST) forms in lisp/files.el be > =09replaced with (mapc 'switch-to-buffer LIST), =E2=80=93 if only to avoi= d > =09the unnecessary consing when the list is effectively copied in > =09the mapcar case. >=20 > =09The lists mapcar is applied to in such cases are returned from > =09find-file-noselect, and so, as it seems, are =E2=80=9Cfresh=E2=80=9D o= nes > =09anyway. Not a good idea, IMHO. It's not just about performance; it's about coding style. By using `mapcar' you are signaling that you are interested in the return v= alues of the argument function (and of course the resulting list of them). By using `mapc' you are signaling that the values returned by the argument = function are unimportant (only its side effects are significant). If you want to improve the performance, and that is the only change you wan= t to make, then please consider another approach.