Commit 40c82261 by Őry Máté

common: evaluate generator before reversing

raised exceptions, and we do have 40 bytes of memory more
parent 069f491e
...@@ -66,7 +66,7 @@ def has_suffix(activity_code, *suffixes): ...@@ -66,7 +66,7 @@ def has_suffix(activity_code, *suffixes):
""" """
equal = lambda a, b: a == b equal = lambda a, b: a == b
act_code_parts = split_activity_code(activity_code) act_code_parts = split_activity_code(activity_code)
suffixes = chain(*imap(split_activity_code, suffixes)) suffixes = list(chain(*imap(split_activity_code, suffixes)))
return all(imap(equal, reversed(act_code_parts), reversed(suffixes))) return all(imap(equal, reversed(act_code_parts), reversed(suffixes)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment