From f3a07ea9bd683ed27896480aeee169b619ad9f68 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 2 Mar 2008 21:42:32 +0000 Subject: [PATCH] Make profile stacking of default USE and package.* slightly more efficient by skipping list.insert() calls when possible. svn path=/main/trunk/; revision=9415 --- pym/portage/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 2d30d0102..d5daf9648 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1878,7 +1878,8 @@ class config(object): else: break del keys - defaults.insert(pos, self.make_defaults_use[i]) + if self.make_defaults_use[i]: + defaults.insert(pos, self.make_defaults_use[i]) pos = len(defaults) defaults = " ".join(defaults) if defaults != self.configdict["defaults"].get("USE",""): @@ -1898,7 +1899,8 @@ class config(object): else: break del keys - useforce.insert(pos, self.useforce_list[i]) + if self.useforce_list[i]: + useforce.insert(pos, self.useforce_list[i]) pos = len(useforce) useforce = set(stack_lists(useforce, incremental=True)) if useforce != self.useforce: @@ -1918,7 +1920,8 @@ class config(object): else: break del keys - usemask.insert(pos, self.usemask_list[i]) + if self.usemask_list[i]: + usemask.insert(pos, self.usemask_list[i]) pos = len(usemask) usemask = set(stack_lists(usemask, incremental=True)) if usemask != self.usemask: -- 2.26.2