aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-07-06 21:23:41 +0200
committerGravatar Numerlor <[email protected]>2020-07-06 21:23:41 +0200
commitfa60e51243c56e6658a91ea63be67a42e22f1512 (patch)
tree36730da8e42d99e303718265358112cf158cdd50
parentAdd option for user to delete the not found message before it's auto deleted. (diff)
Intern `group_names`
-rw-r--r--bot/cogs/doc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/cogs/doc.py b/bot/cogs/doc.py
index b288a92b1..0975285e8 100644
--- a/bot/cogs/doc.py
+++ b/bot/cogs/doc.py
@@ -2,6 +2,7 @@ import asyncio
import functools
import logging
import re
+import sys
import textwrap
from collections import OrderedDict
from contextlib import suppress
@@ -210,7 +211,9 @@ class Doc(commands.Cog):
if "/" in symbol:
continue # skip unreachable symbols with slashes
absolute_doc_url = base_url + relative_doc_url
- group_name = group.split(":")[1]
+ # Intern the group names since they're reused in all the DocItems
+ # to remove unnecessary memory consumption from them being unique objects
+ group_name = sys.intern(group.split(":")[1])
if symbol in self.inventories:
symbol_base_url = self.inventories[symbol].url.split("/", 3)[2]