Why do another assignment and loop, when we can use a simple
compact?

Signed-off-by: Peter Meier <[email protected]>
---
 lib/puppet/parser/ast/astarray.rb |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/lib/puppet/parser/ast/astarray.rb 
b/lib/puppet/parser/ast/astarray.rb
index 529998e..669a78d 100644
--- a/lib/puppet/parser/ast/astarray.rb
+++ b/lib/puppet/parser/ast/astarray.rb
@@ -31,10 +31,7 @@ class Puppet::Parser::AST
         end
       }
 
-      rets = items.flatten.collect { |child|
-        child.safeevaluate(scope)
-      }
-      rets.reject { |o| o.nil? }
+      items.flatten.collect { |child| child.safeevaluate(scope) }.compact
     end
 
     def push(*ary)
-- 
1.7.2.3

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to