From a3bd5ae0fde41bbdc401a7c6fa238a37ad58ac8e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 16 Oct 2007 21:15:00 +0000 Subject: [PATCH] Only re.compile() the normalize_needed pattern once rather than for each dblink constructor call. svn path=/main/trunk/; revision=8152 --- pym/portage/dbapi/vartree.py | 6 ++++-- 1 file 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: -- 2.26.2