From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SE4IQ-0000i4-Je for garchives@archives.gentoo.org; Sat, 31 Mar 2012 19:49:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1DE6E126B; Sat, 31 Mar 2012 19:48:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5F659E126B for ; Sat, 31 Mar 2012 19:48:57 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C2DFC1B400B for ; Sat, 31 Mar 2012 19:48:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 7F843E5402 for ; Sat, 31 Mar 2012 19:48:55 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1333223324.7490a70d40ed47e064a08f10b2319a4b8c9180d9.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/__init__.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 7490a70d40ed47e064a08f10b2319a4b8c9180d9 X-VCS-Branch: master Date: Sat, 31 Mar 2012 19:48:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 5c9ee052-9df1-48c5-9167-fac69cb65a58 X-Archives-Hash: 0cd17c874c666572df55c124f7204448 commit: 7490a70d40ed47e064a08f10b2319a4b8c9180d9 Author: Zac Medico gentoo org> AuthorDate: Sat Mar 31 19:48:44 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Mar 31 19:48:44 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D7490a70d varexpand: use list for efficient append --- pym/portage/util/__init__.py | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index fc4b75b..ae560c0 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -661,21 +661,21 @@ def varexpand(mystring, mydict=3DNone): insing=3D0 indoub=3D0 pos=3D1 - newstring =3D "" + newstring =3D [] while (pos=3Dlen(mystring)): - newstring=3Dnewstring+mystring[pos] + newstring.append(mystring[pos]) break else: a =3D mystring[pos + 1] pos =3D pos + 2 if a in ("\\", "$"): - newstring =3D newstring + a + newstring.append(a) elif a =3D=3D "\n": pass else: - newstring =3D newstring + mystring[pos-2:pos] + newstring.append(mystring[pos - 2:pos]) continue elif (mystring[pos]=3D=3D"$") and (mystring[pos-1]!=3D"\\"): pos=3Dpos+1 @@ -734,15 +734,15 @@ def varexpand(mystring, mydict=3DNone): return "" numvars=3Dnumvars+1 if myvarname in mydict: - newstring=3Dnewstring+mydict[myvarname]=20 + newstring.append(mydict[myvarname]) else: - newstring=3Dnewstring+mystring[pos] + newstring.append(mystring[pos]) pos=3Dpos+1 else: - newstring=3Dnewstring+mystring[pos] + newstring.append(mystring[pos]) pos=3Dpos+1 =20 - return newstring + return "".join(newstring) =20 # broken and removed, but can still be imported pickle_write =3D None