From: Zac Medico Date: Tue, 16 Oct 2007 21:15:00 +0000 (-0000) Subject: Only re.compile() the normalize_needed pattern once X-Git-Tag: v2.2_pre1~606 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a3bd5ae0fde41bbdc401a7c6fa238a37ad58ac8e;p=portage.git Only re.compile() the normalize_needed pattern once rather than for each dblink constructor call. svn path=/main/trunk/; revision=8152 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 38d323849..99db29661 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -821,6 +821,10 @@ class dblink(object): This class provides an interface to the installed package database At present this is implemented as a text backend in /var/db/pkg. """ + + import re + _normalize_needed = re.compile(r'//|^[^/]|.+/$') + def __init__(self, cat, pkg, myroot, mysettings, treetype=None, vartree=None): """ @@ -872,8 +876,6 @@ class dblink(object): self._installed_instance = None self.contentscache = None self._contents_inodes = None - import re - self._normalize_needed = re.compile(r'//|^[^/]|.+/$') def lockdb(self): if self._lock_vdb: