lib/praxis/action_definition.rb
# Good optimization to avoid creating lots of strings and comparisons
# on a per-request basis.
# However, this is hacky, as it is rack-specific, and does not really belong here
Good optimization to avoid creating lots of strings and comparisons
on a per-request basis.
However, this is hacky, as it is rack-specific, and does not really belong here
Good optimization to avoid creating lots of strings and comparisons on a per - request basis . However this is hacky as it is rack - specific and does not really belong here
def precomputed_header_keys_for_rack
      @precomputed_header_keys_for_rack ||= begin
        @headers.attributes.keys.each_with_object(Hash.new) do |key,hash|
          name = key.to_s
          name = "HTTP_#{name.gsub('-','_').upcase}" unless ( name == "CONTENT_TYPE" || name == "CONTENT_LENGTH" )
          hash[name] = key
        end
      end
    end
def precomputed_header_keys_for_rack @precomputed_header_keys_for_rack ||= begin @headers . attributes . keys . each_with_object ( Hash . new ) do | key , hash | name = key . to_s name = "HTTP_#{name.gsub('-','_').upcase}" unless ( name == "CONTENT_TYPE" || name == "CONTENT_LENGTH" ) hash [ name ] = key end end end
Good optimization to avoid creating lots of strings and comparisons
on a per-request basis.
Good optimization to avoid creating lots of strings and comparisons on a per - request basis .