[PATCH] Remove unused code in pure/mpatch.py

Andrey py4fun at gmail.com
Mon Nov 7 06:41:26 CST 2011



> >
> > Please don't use that stupid mirror. It adds confusion and breaks the
> > mail workflow of other users on the list.
>
> I'm curious what the problem is? As far as I can see, the mail has a
> correct In-Reply-To header and was threaded correctly here. Going up
> twice in the thread brings me to the original patch so I don't see
> anything broken here.
>

I do not understand the workflow, but I can re-create and re-sent the 
patch.  No problem.


> I just looked at the patch and it seems to me that the early return is
> there to make the code clearer. Instead of proceeding and doing a whole
> lot of nothing (writing some empty strings into a buffer?) then we exit
> early if we can.
>
> -- 
> Martin Geisler
>
>
> The "whole lot of nothing" is also quick because it operates empty data. 
The result with the removed "if" and without it is identical. The only 
difference is that the removed "if" statement is not run when the data is 
not empty. 
The assumption is that non-empty data is used more frequently then empty 
one. Thus the performance shall be slightly better. 
Also, when the code is changed in the future, there will be no need to test 
that this check works identical to the rest of the code.

-
Andrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111107/0dd2c01d/attachment.html>


More information about the Mercurial-devel mailing list