diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-07-19 19:59:01 -0700 |
---|---|---|
committer | Jesse Wolfe <jes5199@gmail.com> | 2010-07-19 19:59:04 -0700 |
commit | 2af27160b94efa4755187efd99c86d1659683b29 (patch) | |
tree | e478abb994e64164061be7d6adc1f2c8147ec9eb /lib/puppet/parser/compiler.rb | |
parent | 21efa7b282080c69760a17576dff60c01821a963 (diff) | |
parent | d87a2e39d1a6104c52b1213a654ec9d58d0bff7f (diff) | |
download | puppet-2af27160b94efa4755187efd99c86d1659683b29.tar.gz puppet-2af27160b94efa4755187efd99c86d1659683b29.tar.xz puppet-2af27160b94efa4755187efd99c86d1659683b29.zip |
Merge branch 'master' into next
This is the code for 2.6 RC4
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 85980722c..a901c0dd6 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -251,19 +251,7 @@ class Puppet::Parser::Compiler # evaluate_generators loop. def evaluate_definitions exceptwrap do - if ary = unevaluated_resources - evaluated = false - ary.each do |resource| - if not resource.virtual? - resource.evaluate - evaluated = true - end - end - # If we evaluated, let the loop know. - return evaluated - else - return false - end + !unevaluated_resources.each { |resource| resource.evaluate }.empty? end end @@ -482,12 +470,7 @@ class Puppet::Parser::Compiler # Return an array of all of the unevaluated resources. These will be definitions, # which need to get evaluated into native resources. def unevaluated_resources - ary = resources.reject { |resource| resource.builtin? or resource.evaluated? } - - if ary.empty? - return nil - else - return ary - end + # The order of these is significant for speed due to short-circuting + resources.reject { |resource| resource.evaluated? or resource.virtual? or resource.builtin_type? } end end |