Small refactoring.

This commit is contained in:
Griatch 2016-12-11 22:07:38 +01:00
parent 336002fc7f
commit 958b333a59

View file

@ -1666,9 +1666,8 @@ def m_len(target):
"""
# Would create circular import if in module root.
from evennia.utils.ansi import ANSI_PARSER
if inherits_from(target, basestring):
if "|lt" in target:
return len(ANSI_PARSER.strip_mxp(target))
if inherits_from(target, basestring) and "|lt" in target:
return len(ANSI_PARSER.strip_mxp(target))
return len(target)
#------------------------------------------------------------------