Reduce Array object allocation

This commit is contained in:
Akira Matsuda 2022-05-07 16:05:29 +09:00
parent 4e7620b110
commit b368c68c6a
No known key found for this signature in database

@ -138,15 +138,13 @@ def generate_strong_etag(validators)
def cache_control_segments
if cache_control = _cache_control
cache_control.delete(" ").split(",")
else
[]
end
end
def cache_control_headers
cache_control = {}
cache_control_segments.each do |segment|
cache_control_segments&.each do |segment|
directive, argument = segment.split("=", 2)
if SPECIAL_KEYS.include? directive