aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-07-05 04:01:19 -0400
committerRapptz <[email protected]>2021-07-07 20:19:17 -0400
commit88d825a803917ab3e0e9797df9f47be7ed79bb9c (patch)
treebb2022314c7b1a7159259f80809269dc8fbd27c8 /discord/http.py
parentType-hint backoff.py (diff)
downloaddiscord.py-88d825a803917ab3e0e9797df9f47be7ed79bb9c.tar.xz
discord.py-88d825a803917ab3e0e9797df9f47be7ed79bb9c.zip
Allow use of orjson instead of json
The difference in speed seems negligible at start up, which is when most time is taken for actually parsing JSON. I could potentially be missing something but profiling didn't point to any discernable difference.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/discord/http.py b/discord/http.py
index cfc71e22..c9c340ae 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -99,7 +99,7 @@ async def json_or_text(response: aiohttp.ClientResponse) -> Union[Dict[str, Any]
text = await response.text(encoding='utf-8')
try:
if response.headers['content-type'] == 'application/json':
- return json.loads(text)
+ return utils.from_json(text)
except KeyError:
# Thanks Cloudflare
pass