Patchwork _lazymanifest: drop unnecessary call to sorted()

login
register
mail settings
Submitter Martin von Zweigbergk
Date March 29, 2015, 6:15 a.m.
Message ID <d9cc0d84339732f87b07.1427609715@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8342/
State Accepted
Headers show

Comments

Martin von Zweigbergk - March 29, 2015, 6:15 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1427514954 25200
#      Fri Mar 27 20:55:54 2015 -0700
# Node ID d9cc0d84339732f87b072688b0624d49fdf5436a
# Parent  efa094701a05d58d505c3b0c3b3c73dba4e51e97
_lazymanifest: drop unnecessary call to sorted()

The entries returned from _lazymanifest.iterentries() are already
sorted.
Augie Fackler - March 30, 2015, 2:43 p.m.
On Sat, Mar 28, 2015 at 11:15:15PM -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1427514954 25200
> #      Fri Mar 27 20:55:54 2015 -0700
> # Node ID d9cc0d84339732f87b072688b0624d49fdf5436a
> # Parent  efa094701a05d58d505c3b0c3b3c73dba4e51e97
> _lazymanifest: drop unnecessary call to sorted()

Queued, thanks.

>
> The entries returned from _lazymanifest.iterentries() are already
> sorted.
>
> diff -r efa094701a05 -r d9cc0d843397 mercurial/manifest.py
> --- a/mercurial/manifest.py	Fri Mar 27 14:11:13 2015 -0700
> +++ b/mercurial/manifest.py	Fri Mar 27 20:55:54 2015 -0700
> @@ -87,7 +87,7 @@
>
>      def text(self):
>          """Get the full data of this manifest as a bytestring."""
> -        fl = sorted(self.iterentries())
> +        fl = self.iterentries()
>
>          _hex = revlog.hex
>          # if this is changed to support newlines in filenames,
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r efa094701a05 -r d9cc0d843397 mercurial/manifest.py
--- a/mercurial/manifest.py	Fri Mar 27 14:11:13 2015 -0700
+++ b/mercurial/manifest.py	Fri Mar 27 20:55:54 2015 -0700
@@ -87,7 +87,7 @@ 
 
     def text(self):
         """Get the full data of this manifest as a bytestring."""
-        fl = sorted(self.iterentries())
+        fl = self.iterentries()
 
         _hex = revlog.hex
         # if this is changed to support newlines in filenames,