changeset 20679:0916f829eb8d

util: 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:19:20 -0400
parents da6bea33007b
children d3d3e94e2910
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Wed Mar 12 13:29:07 2014 -0400
+++ b/mercurial/util.py	Wed Mar 12 13:19:20 2014 -0400
@@ -1198,11 +1198,11 @@
     """
 
     def lower(date):
-        d = dict(mb="1", d="1")
+        d = {'mb': "1", 'd': "1"}
         return parsedate(date, extendeddateformats, d)[0]
 
     def upper(date):
-        d = dict(mb="12", HI="23", M="59", S="59")
+        d = {'mb': "12", 'HI': "23", 'M': "59", 'S': "59"}
         for days in ("31", "30", "29"):
             try:
                 d["d"] = days