merge-recursive: Speed up commit graph construction
Use __slots__ to speed up construction and decrease memory consumption of the Commit objects. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
008bb6ea69
commit
97f58b785d
@ -107,7 +107,10 @@ def isSha(obj):
|
|||||||
return (type(obj) is str and bool(shaRE.match(obj))) or \
|
return (type(obj) is str and bool(shaRE.match(obj))) or \
|
||||||
(type(obj) is int and obj >= 1)
|
(type(obj) is int and obj >= 1)
|
||||||
|
|
||||||
class Commit:
|
class Commit(object):
|
||||||
|
__slots__ = ['parents', 'firstLineMsg', 'children', '_tree', 'sha',
|
||||||
|
'virtual']
|
||||||
|
|
||||||
def __init__(self, sha, parents, tree=None):
|
def __init__(self, sha, parents, tree=None):
|
||||||
self.parents = parents
|
self.parents = parents
|
||||||
self.firstLineMsg = None
|
self.firstLineMsg = None
|
||||||
|
Loading…
Reference in New Issue
Block a user