2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00

Optimize property-set.get: avoid linear search.

[SVN r26579]
This commit is contained in:
Vladimir Prus
2004-12-23 09:04:13 +00:00
parent aa05391a55
commit 9b503a0bb5

View File

@@ -309,7 +309,19 @@ class property-set
# Returns all values of 'feature'.
rule get ( feature )
{
return [ feature.get-values $(feature) : $(self.raw) ] ;
if ! $(self.map-built)
{
# For each feature, create member var and assign all
# values to it. Since all regular member vars start with
# 'self', there will be no conflicts between names.
self.map-built = true ;
for local v in $(self.raw)
{
$(v:G) += $(v:G=) ;
}
}
return $($(feature)) ;
}
}