Mercurial > public > mercurial-scm > hg
comparison mercurial/node.py @ 4995:e45fc5d03798
manifest: speed up creation of the manifestdict
- fold iteration and rawset into parse
- avoid creating extra new strings with [:] where possible
- speed up node.bin
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 23 Jul 2007 20:44:08 -0500 |
parents | abaee83ce0a6 |
children | 46293a0c7e9f |
comparison
equal
deleted
inserted
replaced
4994:d36310dd51d7 | 4995:e45fc5d03798 |
---|---|
10 import binascii | 10 import binascii |
11 | 11 |
12 nullrev = -1 | 12 nullrev = -1 |
13 nullid = "\0" * 20 | 13 nullid = "\0" * 20 |
14 | 14 |
15 def hex(node): | 15 # This ugly style has a noticeable effect in manifest parsing |
16 return binascii.hexlify(node) | 16 hex = binascii.hexlify |
17 | 17 bin = binascii.unhexlify |
18 def bin(node): | |
19 return binascii.unhexlify(node) | |
20 | 18 |
21 def short(node): | 19 def short(node): |
22 return hex(node[:6]) | 20 return hex(node[:6]) |