Concatenate arrays without modifying the first array
This commit is contained in:
parent
c5f6c26d67
commit
85d5eadbab
1 changed files with 1 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue