There's no need to test all of the tokens we're looking at. If the first one

is a command, bail out.
This commit is contained in:
James Vega 2004-07-31 06:32:01 +00:00
parent c98ac36ccc
commit 0412055a85

View File

@ -265,11 +265,7 @@ class Infobot(callbacks.PrivmsgCommandAndRegexp):
if self.addressed: if self.addressed:
try: try:
tokens = callbacks.tokenize(payload) tokens = callbacks.tokenize(payload)
getCallback = callbacks.findCallbackForCommand if callbacks.findCallbackForCommand(irc, tokens[0]):
commands = filter(None,
map(lambda c, i=irc: getCallback(i, c),
tokens))
if commands:
return return
else: else:
payload += '?' payload += '?'