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 1SdqV4-0003KW-GN for garchives@archives.gentoo.org; Sun, 10 Jun 2012 22:20:46 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77A82E0552; Sun, 10 Jun 2012 22:20:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 43AB2E0552 for ; Sun, 10 Jun 2012 22:20:39 +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 AC7991B4036 for ; Sun, 10 Jun 2012 22:20:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6E14DE542E for ; Sun, 10 Jun 2012 22:20:37 +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: <1339366823.2a5d810445fa819ce64218b17dc70b3228cd61c5.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dep/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dep/__init__.py X-VCS-Directories: pym/portage/dep/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 2a5d810445fa819ce64218b17dc70b3228cd61c5 X-VCS-Branch: master Date: Sun, 10 Jun 2012 22:20:37 +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: 09c93cff-8041-4dfd-87ae-4b40ae7091a7 X-Archives-Hash: e0bdfd5d5d327a705e6c79bf39f461a7 commit: 2a5d810445fa819ce64218b17dc70b3228cd61c5 Author: Zac Medico gentoo org> AuthorDate: Sun Jun 10 22:20:23 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Jun 10 22:20:23 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D2a5d8104 _get_atom_re: share cache between more EAPIs --- pym/portage/dep/__init__.py | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index d2b885b..27b90b9 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -86,7 +86,8 @@ def _get_eapi_attrs(eapi): _atom_re_cache =3D {} =20 def _get_atom_re(eapi_attrs): - atom_re =3D _atom_re_cache.get(eapi_attrs) + cache_key =3D eapi_attrs.dots_in_PN + atom_re =3D _atom_re_cache.get(cache_key) if atom_re is not None: return atom_re =20 @@ -104,7 +105,7 @@ def _get_atom_re(eapi_attrs): '(' + _slot_separator + _slot + ')?' + _repo + ')(' + _use + ')?$', re.VERBOSE) =20 - _atom_re_cache[eapi_attrs] =3D atom_re + _atom_re_cache[cache_key] =3D atom_re return atom_re =20 _usedep_re_cache =3D {} @@ -117,7 +118,8 @@ def _get_usedep_re(eapi_attrs): @return: A regular expression object that matches valid USE deps for th= e given eapi. """ - usedep_re =3D _usedep_re_cache.get(eapi_attrs) + cache_key =3D eapi_attrs.dots_in_use_flags + usedep_re =3D _usedep_re_cache.get(cache_key) if usedep_re is not None: return usedep_re =20 @@ -129,7 +131,7 @@ def _get_usedep_re(eapi_attrs): usedep_re =3D re.compile(r'^(?P[!-]?)(?P' + _flag_re + r')(?P(\(\+\)|\(\-\))?)(?P[?=3D]?)$') =20 - _usedep_re_cache[eapi_attrs] =3D usedep_re + _usedep_re_cache[cache_key] =3D usedep_re return usedep_re =20 _useflag_re_cache =3D {}