From: Zac Medico Date: Fri, 28 Mar 2008 11:56:50 +0000 (-0000) Subject: Make strip_empty() return a nedw list instead of working in-place. Thanks to X-Git-Tag: v2.1.5~338 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=04f753b4e6283571481ba7fe823d06259da276c1;p=portage.git Make strip_empty() return a nedw list instead of working in-place. Thanks to René Neumann for the suggestion. (trunk r9460) svn path=/main/branches/2.1.2/; revision=9552 --- 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): """