diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-16 21:15:00 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-16 21:15:00 +0000 |
commit | a3bd5ae0fde41bbdc401a7c6fa238a37ad58ac8e (patch) | |
tree | b255397417b80bf999a998042e5d364d289726ef | |
parent | 8fa22d41766a0c6b8198e6d3642c6f969e46da9f (diff) | |
download | portage-a3bd5ae0fde41bbdc401a7c6fa238a37ad58ac8e.tar.gz portage-a3bd5ae0fde41bbdc401a7c6fa238a37ad58ac8e.tar.bz2 portage-a3bd5ae0fde41bbdc401a7c6fa238a37ad58ac8e.zip |
Only re.compile() the normalize_needed pattern once
rather than for each dblink constructor call.
svn path=/main/trunk/; revision=8152
-rw-r--r-- | pym/portage/dbapi/vartree.py | 6 |
1 files changed, 4 insertions, 2 deletions
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: |