fix: response.json() call makes unnecessary memory allocation

This commit is contained in:
Jalil SA 2023-08-17 10:22:17 -06:00
parent 3318971512
commit 19867659f3
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class TextResponse(Response):
Deserialize a JSON document to a Python object.
"""
if self._cached_decoded_json is _NONE:
self._cached_decoded_json = json.loads(self.text)
self._cached_decoded_json = json.loads(self.body)
return self._cached_decoded_json
@property