projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f5d814
)
Refactor _merge_logentries() to make it a little more efficient.
author
Zac Medico
<zmedico@gentoo.org>
Fri, 19 Oct 2007 19:33:38 +0000
(19:33 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Fri, 19 Oct 2007 19:33:38 +0000
(19:33 -0000)
svn path=/main/trunk/; revision=8184
pym/portage/elog/__init__.py
patch
|
blob
|
history
diff --git
a/pym/portage/elog/__init__.py
b/pym/portage/elog/__init__.py
index b9cc3f659920aaa8ec2d2d41bd9e01aa20e64cdd..e1df6d9bd3c2f0d8ac8630316a6d89304f7e1a97 100644
(file)
--- a/
pym/portage/elog/__init__.py
+++ b/
pym/portage/elog/__init__.py
@@
-18,13
+18,12
@@
def _merge_logentries(a, b):
phases = set(a)
phases.update(b)
for p in phases:
- rValue[p] = []
- if a.has_key(p):
- for x in a[p]:
- rValue[p].append(x)
- if b.has_key(p):
- for x in b[p]:
- rValue[p].append(x)
+ merged_msgs = []
+ rValue[p] = merged_msgs
+ for d in a, b:
+ msgs = d.get(p)
+ if msgs:
+ merged_msgs.extend(msgs)
return rValue
def _combine_logentries(logentries):