Skip to content

Commit 3aae0d4

Browse files
committed
micro optimization: sort the uniq set rather than sorting a set and calling uniq
1 parent 370ada3 commit 3aae0d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/secure_headers/headers/content_security_policy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module Constants
6666
DIRECTIVES_2_0 + DIRECTIVES_DRAFT
6767
).freeze
6868

69-
ALL_DIRECTIVES = [DIRECTIVES_1_0 + DIRECTIVES_2_0 + DIRECTIVES_3_0 + DIRECTIVES_DRAFT].flatten.sort.uniq
69+
ALL_DIRECTIVES = [DIRECTIVES_1_0 + DIRECTIVES_2_0 + DIRECTIVES_3_0 + DIRECTIVES_DRAFT].flatten.uniq.sort
7070
CONFIG_KEY = :csp
7171
end
7272

0 commit comments

Comments
 (0)