Speedup for m_len to not do the regex when not needed
This commit is contained in:
parent
f2fda4b1bd
commit
336002fc7f
1 changed files with 2 additions and 1 deletions
|
|
@ -1667,6 +1667,7 @@ def m_len(target):
|
||||||
# Would create circular import if in module root.
|
# Would create circular import if in module root.
|
||||||
from evennia.utils.ansi import ANSI_PARSER
|
from evennia.utils.ansi import ANSI_PARSER
|
||||||
if inherits_from(target, basestring):
|
if inherits_from(target, basestring):
|
||||||
|
if "|lt" in target:
|
||||||
return len(ANSI_PARSER.strip_mxp(target))
|
return len(ANSI_PARSER.strip_mxp(target))
|
||||||
return len(target)
|
return len(target)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue