Refs #33546 -- Optimized ResponseHeaders._convert_to_charset() by reducing the type-checking duplication.
Refs #33546 -- Optimized ResponseHeaders._convert_to_charset() by reducing the type-checking duplication.

In the common case, where keys and values are be encoded into
ascii/latin-1, defer the checking for newlines until it's been
successfully coerced to a string.

Co-authored-by: Nick Pope <75ef9faee755c70589550b513ad881e5a603182c@nickpope.me.uk>

MarkusH/django,blighj/django,apollo13/django,solarissmoke/django,shaib/django,auvipy/django,takis/django,takis/django,MarkusH/django,manhhomienbienthuy/django,monetate/django,dsanders11/django,solarissmoke/django,auvipy/django,django/django,manhhomienbienthuy/django,auvipy/django,auvipy/django,rsalmaso/django,MarkusH/django,felixxm/django,manhhomienbienthuy/django,MarkusH/django,django/django,pauloxnet/django,blighj/django,shaib/django,apollo13/django,rsalmaso/django,apollo13/django,felixxm/django,manhhomienbienthuy/django,felixxm/django,shaib/django,rsalmaso/django,monetate/django,takis/django,blighj/django,felixxm/django,blighj/django,rsalmaso/django,solarissmoke/django,monetate/django,dsanders11/django,pauloxnet/django,apollo13/django,dsanders11/django,django/django,solarissmoke/django,pauloxnet/django,shaib/django,dsanders11/django,pauloxnet/django,django/django,takis/django,monetate/django