diff options
| author | Rapptz <[email protected]> | 2021-07-05 04:01:19 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-07-07 20:19:17 -0400 |
| commit | 88d825a803917ab3e0e9797df9f47be7ed79bb9c (patch) | |
| tree | bb2022314c7b1a7159259f80809269dc8fbd27c8 /discord/http.py | |
| parent | Type-hint backoff.py (diff) | |
| download | discord.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.py | 2 |
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 |