From: Zac Medico Date: Thu, 13 Mar 2008 18:04:50 +0000 (-0000) Subject: Make strip_empty() return a nedw list instead of working in-place. Thanks to X-Git-Tag: v2.2_pre5~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba85ab2fc704f1617c7b60d4f3e454968b705376;p=portage.git Make strip_empty() return a nedw list instead of working in-place. Thanks to René Neumann for the suggestion. svn path=/main/trunk/; revision=9460 --- 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): """