Skip to content

Commit 55cb6d3

Browse files
authored
Remove unnecessary .compact call (#562)
The `.compact` method is used to remove nil elements from an array. However, in this context, it is unnecessary because the `.map` operation is already creating an array of strings, and there's no `nil` values that could be removed
1 parent 8f51900 commit 55cb6d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/arbre/html/attributes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Attributes < Hash
66
def to_s
77
flatten_hash.compact.map do |name, value|
88
"#{html_escape(name)}=\"#{html_escape(value)}\""
9-
end.compact.join ' '
9+
end.join ' '
1010
end
1111

1212
protected

0 commit comments

Comments
 (0)