changeset 20675:f8d50add83e1

changegroup: move from dict() construction to {} literals The latter are both faster and more consistent across Python 2 and 3.
author Augie Fackler <raf@durin42.com>
date Wed, 12 Mar 2014 13:14:31 -0400
parents 2aafd5854243
children 89b2336e5ccf
files mercurial/changegroup.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Wed Mar 12 13:13:42 2014 -0400
+++ b/mercurial/changegroup.py	Wed Mar 12 13:14:31 2014 -0400
@@ -173,7 +173,7 @@
         if not l:
             return {}
         fname = readexactly(self._stream, l)
-        return dict(filename=fname)
+        return {'filename': fname}
 
     def _deltaheader(self, headertuple, prevnode):
         node, p1, p2, cs = headertuple
@@ -191,8 +191,8 @@
         header = struct.unpack(self.deltaheader, headerdata)
         delta = readexactly(self._stream, l - self.deltaheadersize)
         node, p1, p2, deltabase, cs = self._deltaheader(header, prevnode)
-        return dict(node=node, p1=p1, p2=p2, cs=cs,
-                    deltabase=deltabase, delta=delta)
+        return {'node': node, 'p1': p1, 'p2': p2, 'cs': cs,
+                'deltabase': deltabase, 'delta': delta}
 
 class headerlessfixup(object):
     def __init__(self, fh, h):