Skip to content

Commit

Permalink
Merge pull request #140 from baweaver/baweaver/performance/header-cap…
Browse files Browse the repository at this point in the history
…italize-regex-replacement

Replace Regexp in  for headers for perf
  • Loading branch information
hsbt authored May 30, 2024
2 parents eabd7d8 + 826e008 commit d39f1e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/http/header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def each_capitalized
alias canonical_each each_capitalized

def capitalize(name)
name.to_s.split(/-/).map {|s| s.capitalize }.join('-')
name.to_s.split('-'.freeze).map {|s| s.capitalize }.join('-'.freeze)
end
private :capitalize

Expand Down

0 comments on commit d39f1e3

Please sign in to comment.