From cfc6749556389683c4808d01fcbb8098eaff4efb Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 24 Feb 2015 10:08:16 +0100 Subject: [PATCH] Use splat instead of Array#unshift for attributes. --- lib/oga/xml/parser.rll | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/oga/xml/parser.rll b/lib/oga/xml/parser.rll index c9d47e4..28f65a1 100644 --- a/lib/oga/xml/parser.rll +++ b/lib/oga/xml/parser.rll @@ -158,11 +158,7 @@ element attributes = attributes_ { on_attributes(val[0]) }; attributes_ - = attribute attributes_ - { - val[1].unshift(val[0]) if val[0] - val[1] - } + = attribute attributes_ { val[0] ? [val[0], *val[1]] : val[1] } | _ ;