From 80637e497ee04ad79885af775e6d7dc96b346b63 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 12 Jul 2006 17:12:06 +0000 Subject: [PATCH] Use startswith instead of slices to simplify config protect code. svn path=/main/trunk/; revision=3838 --- pym/portage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 7a614dbd6..703c905c6 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5826,11 +5826,11 @@ class config_protect(object): masked=0 protected=0 for ppath in self.protect: - if (len(ppath) > masked) and (obj[0:len(ppath)]==ppath): + if len(ppath) > masked and obj.startswith(ppath): protected=len(ppath) #config file management for pmpath in self.protectmask: - if (len(pmpath) >= protected) and (obj[0:len(pmpath)]==pmpath): + if len(pmpath) >= protected and obj.startswith(pmpath): #skip, it's in the mask masked=len(pmpath) return (protected > masked) -- 2.26.2