summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Environment.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-12-31 01:08:05 (GMT)
committerSteven Knight <knight@baldmt.com>2004-12-31 01:08:05 (GMT)
commit7fcaaa7094571eb2802cca18f8452049eafb68d1 (patch)
treeb801f61f2f4109c75c7526762270d270eb5b99a1 /src/engine/SCons/Environment.py
parenta2b119edf2fdd972c426f08f9898fb2efbe36646 (diff)
downloadSCons-7fcaaa7094571eb2802cca18f8452049eafb68d1.zip
SCons-7fcaaa7094571eb2802cca18f8452049eafb68d1.tar.gz
SCons-7fcaaa7094571eb2802cca18f8452049eafb68d1.tar.bz2
Apply Memoizer to cache more return values from various methods. (Kevin Quick)
Diffstat (limited to 'src/engine/SCons/Environment.py')
-rw-r--r--src/engine/SCons/Environment.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index 2e146e3..8c2e767 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -264,12 +264,14 @@ class SubstitutionEnvironment:
return cmp(sdict, odict)
def __delitem__(self, key):
+ "__cache_reset__"
del self._dict[key]
def __getitem__(self, key):
return self._dict[key]
def __setitem__(self, key, value):
+ "__cache_reset__"
if key in reserved_construction_var_names:
SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning,
"Ignoring attempt to set reserved variable `%s'" % key)
@@ -599,6 +601,7 @@ class Base(SubstitutionEnvironment):
def _update(self, dict):
"""Update an environment's values directly, bypassing the normal
checks that occur when users try to set items.
+ __cache_reset__
"""
self._dict.update(dict)
@@ -743,7 +746,7 @@ class Base(SubstitutionEnvironment):
return clone
def Detect(self, progs):
- """Return the first available program in progs.
+ """Return the first available program in progs. __cacheable__
"""
if not SCons.Util.is_List(progs):
progs = [ progs ]
@@ -1011,7 +1014,7 @@ class Base(SubstitutionEnvironment):
except KeyError:
pass
kw = copy_non_reserved_keywords(kw)
- self._dict.update(our_deepcopy(kw))
+ self._update(our_deepcopy(kw))
self.scanner_map_delete(kw)
def ReplaceIxes(self, path, old_prefix, old_suffix, new_prefix, new_suffix):
@@ -1052,7 +1055,7 @@ class Base(SubstitutionEnvironment):
tool(self)
def WhereIs(self, prog, path=None, pathext=None, reject=[]):
- """Find prog in the path.
+ """Find prog in the path. __cacheable__
"""
if path is None:
try: