From ba85ab2fc704f1617c7b60d4f3e454968b705376 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 13 Mar 2008 18:04: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.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit svn path=/main/trunk/; revision=9460 --- pym/portage/dep.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pym/portage/dep.py b/pym/portage/dep.py index bf42d2ba8..2a1a3cfa5 100644 --- a/pym/portage/dep.py +++ b/pym/portage/dep.py @@ -63,11 +63,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