[commands] Optimise GroupMixin.get_command for the no space case.
Comes at a 30ns slowdown for the space case, however.
This commit is contained in:
parent
8466250bcc
commit
3326adf63b
@ -1015,6 +1015,10 @@ class GroupMixin:
|
|||||||
The command that was requested. If not found, returns ``None``.
|
The command that was requested. If not found, returns ``None``.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# fast path, no space in name.
|
||||||
|
if ' ' not in name:
|
||||||
|
return self.all_commands.get(name)
|
||||||
|
|
||||||
names = name.split()
|
names = name.split()
|
||||||
obj = self.all_commands.get(names[0])
|
obj = self.all_commands.get(names[0])
|
||||||
if not isinstance(obj, GroupMixin):
|
if not isinstance(obj, GroupMixin):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user