lib/roadie/style_attribute_builder.rb in roadie-4.0.0 vs lib/roadie/style_attribute_builder.rb in roadie-5.0.0

- old
+ new

@@ -9,13 +9,14 @@ def <<(style) @styles << style end def attribute_string - Deduplicator.apply(stable_sort(@styles).map(&:to_s)).join(';') + Deduplicator.apply(stable_sort(@styles).map(&:to_s)).join(";") end private + def stable_sort(list) # Ruby's sort is unstable for performance reasons. We need it to be # stable, e.g. to preserve order of elements that are compared equal in # the sorting. # We can accomplish this by using the original array index as a second