summaryrefslogtreecommitdiff
path: root/gitMergeCommon.py
diff options
context:
space:
mode:
authorFredrik Kuivinen <freku045@student.liu.se>2006-02-02 11:43:35 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-02 20:30:51 (GMT)
commit97f58b785d6c5c86b52a365b0086b5b098f5ee97 (patch)
treea7d315ab1cd868b34297b54e5aa2d2a82f36e574 /gitMergeCommon.py
parent008bb6ea695e14740bfd14bec805cde6219b336e (diff)
downloadgit-97f58b785d6c5c86b52a365b0086b5b098f5ee97.zip
git-97f58b785d6c5c86b52a365b0086b5b098f5ee97.tar.gz
git-97f58b785d6c5c86b52a365b0086b5b098f5ee97.tar.bz2
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>
Diffstat (limited to 'gitMergeCommon.py')
-rw-r--r--gitMergeCommon.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gitMergeCommon.py b/gitMergeCommon.py
index ff6f58a..fdbf9e4 100644
--- a/gitMergeCommon.py
+++ b/gitMergeCommon.py
@@ -107,7 +107,10 @@ def isSha(obj):
return (type(obj) is str and bool(shaRE.match(obj))) or \
(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):
self.parents = parents
self.firstLineMsg = None