emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mailcap-add-mailcap-entry: Superfluous setcdr, readability,


From: Lars Ingebrigtsen
Subject: Re: [PATCH] mailcap-add-mailcap-entry: Superfluous setcdr, readability, entry overriding
Date: Wed, 09 Mar 2022 15:03:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Felix Dietrich <felix.dietrich@sperrhaken.name> writes:

> Given that setcdr returns its second argument, i.e. the NEWCDR, I
> believe that setcdr here is essentially called twice with the same
> arguments.  Therefore, one of the setcdr calls is superfluous and should
> be removed.

Yup.

> The first, relating to readability: I found it quit difficult to follow
> the flow of the functionʼs code due to its nesting and idiosyncratic
> order of condition checking.  I want to, therefore, propose a
> restructured version, which I believe to be functionally equivalent.

Yes, the code is pretty confusing...  so reading the patches, I'm not
quite sure whether the new one is equivalent or not.  So I think we'd
want to have a number of tests in mailcap-tests.el to test that the
results really are equivalent before and after the change, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]