direct: fix slowness in big games with Func(messenger.send)

This commit is contained in:
rdb 2018-10-18 22:19:55 +02:00
parent f35c9e5d79
commit f8b47dc14c
1 changed files with 4 additions and 1 deletions

View File

@ -77,7 +77,10 @@ class FunctionInterval(Interval.Interval):
@staticmethod
def makeUniqueName(func, suffix = ''):
name = 'Func-%s-%d' % (getattr(func, '__name__', str(func)), FunctionInterval.functionIntervalNum)
func_name = getattr(func, '__name__', None)
if func_name is None:
func_name = str(func)
name = 'Func-%s-%d' % (func_name, FunctionInterval.functionIntervalNum)
FunctionInterval.functionIntervalNum += 1
if suffix:
name = '%s-%s' % (name, str(suffix))