From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] src/eval.c (Fapply): Remove unnecessary goto Date: Thu, 04 Dec 2014 14:18:24 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417720756 10598 80.91.229.3 (4 Dec 2014 19:19:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2014 19:19:16 +0000 (UTC) Cc: Emacs Devel To: Lee Duhem Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 04 20:19:05 2014 Return-path: Envelope-to: ged-emacs-devel@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 1Xwbvc-0001Zn-5Y for ged-emacs-devel@m.gmane.org; Thu, 04 Dec 2014 20:19:04 +0100 Original-Received: from localhost ([::1]:47430 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwbvb-0000RY-OH for ged-emacs-devel@m.gmane.org; Thu, 04 Dec 2014 14:19:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwbv7-0000FJ-W8 for emacs-devel@gnu.org; Thu, 04 Dec 2014 14:18:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xwbv0-0003K7-HE for emacs-devel@gnu.org; Thu, 04 Dec 2014 14:18:33 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:8461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwbv0-0003K2-C7 for emacs-devel@gnu.org; Thu, 04 Dec 2014 14:18:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4PAOwQflRMCqTq/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBBCcvIxALNBIUGA0kiFPWWQEBAQEBBQEBAQEekG8HhEgFiwGSMY9zggqBeIQZIYJ3AQEB X-IPAS-Result: Aj4PAOwQflRMCqTq/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBBCcvIxALNBIUGA0kiFPWWQEBAQEBBQEBAQEekG8HhEgFiwGSMY9zggqBeIQZIYJ3AQEB X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="99572440" Original-Received: from 76-10-164-234.dsl.teksavvy.com (HELO pastel.home) ([76.10.164.234]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 04 Dec 2014 14:18:24 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 638D2996B; Thu, 4 Dec 2014 14:18:24 -0500 (EST) In-Reply-To: (Lee Duhem's message of "Tue, 25 Nov 2014 11:21:00 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178849 Archived-At: > @@ -1532,8 +1532,7 @@ See also the function `condition-case'. */) > || NILP (clause) > /* A `debug' symbol in the handler list disables the normal > suppression of the debugger. */ > - || (CONSP (clause) && CONSP (clause) > - && !NILP (Fmemq (Qdebug, clause))) > + || (CONSP (clause) && !NILP (Fmemq (Qdebug, clause))) > /* Special handler that means "print a message and run debugger > if requested". */ > || EQ (h->tag_or_ch, Qerror))) Oops, indeed. Installed in emacs-24. > + * eval.c (Fapply): Remove unnecessary goto. Yes, that function was poorly structured. I had some restructuring in my local tree as well for a long time, so I took advantage of your patch to do a more thorough job (installed in master). > - if (numargs < XSUBR (fun)->min_args > - || (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args < numargs)) > - goto funcall; /* Let funcall get the error. */ > - else if (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args > numargs) > + if (XSUBR (fun)->max_args >= 0 && XSUBR (fun)->max_args > numargs) This is actually not quite right: you fail to test numargs < XSUBR (fun)->min_args which means that you can end up adding args which are truly missing (i.e. not optional). > + * eval.c(Fbacktrace): Avoid unnecessary strlen calls. I'm ambivalent on this one: printing the backtrace really shouldn't be performance sensitive, and using -1 makes it easier to change the code. Stefan