From 04f753b4e6283571481ba7fe823d06259da276c1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 28 Mar 2008 11:56:50 +0000 Subject: [PATCH] =?utf8?q?Make=20strip=5Fempty()=20return=20a=20nedw=20lis?= =?utf8?q?t=20instead=20of=20working=20in-place.=20Thanks=20to=20Ren=C3=A9?= =?utf8?q?=20Neumann=20=20for=20the=20suggestion.?= =?utf8?q?=20(trunk=20r9460)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/main/branches/2.1.2/; revision=9552 --- pym/portage_dep.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pym/portage_dep.py b/pym/portage_dep.py index 2ac6ada99..5bb9c0562 100644 --- a/pym/portage_dep.py +++ b/pym/portage_dep.py @@ -44,10 +44,7 @@ def strip_empty(myarr): @rtype: Array @return: The array with empty elements removed """ - for x in range(len(myarr)-1, -1, -1): - if not myarr[x]: - del myarr[x] - return myarr + return [x for x in myarr if x] def paren_reduce(mystr,tokenize=1): """ -- 2.26.2