]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Concatenate arrays without modifying the first array
authorColleen Murphy <cmurphy@cat.pdx.edu>
Wed, 20 Nov 2013 04:24:46 +0000 (20:24 -0800)
committerHunter Haugen <hunter@puppetlabs.com>
Thu, 31 Jul 2014 18:22:18 +0000 (11:22 -0700)
lib/puppet/parser/functions/concat.rb

index 6c8638222ef00aeffbd3473bbed6aee2a51e268b..0d35b07eb8da96706bb799183d73350ae4be0259 100644 (file)
@@ -28,11 +28,7 @@ Would result in:
       raise(Puppet::ParseError, 'concat(): Requires array to work with')
     end
 
-    if b.is_a?(Array)
-      result = a.concat(b)
-    else
-      result = a << b
-    end
+    result = a + Array(b)
 
     return result
   end