Optimized event name

Use a static char*, instead of an allocated str
This commit is contained in:
smallmodel committed 2023-09-07 18:05:49 +02:00
1 parent e8d2a2a461
commit 47a3c0bf55
7 files changed
+99 -80

No files matched your search

+3 -3
View File
@@ -598,7 +598,7 @@ void ScriptVM::execCmdMethodCommon(op_parmNum_t param)
const size_t arraysize = a.arraysize();
if (arraysize == (size_t)-1) {
throw ScriptException("command '%s' applied to NIL", Event::GetEventName(eventNum).c_str());
throw ScriptException("command '%s' applied to NIL", Event::GetEventName(eventNum));
}
if (arraysize > 1) {
@@ -634,7 +634,7 @@ void ScriptVM::execCmdMethodCommon(op_parmNum_t param)
// avoid useless allocations of const array
Listener *const listener = a.listenerValue();
if (!listener) {
throw ScriptException("command '%s' applied to NULL listener", Event::GetEventName(eventNum).c_str());
throw ScriptException("command '%s' applied to NULL listener", Event::GetEventName(eventNum));
}
executeCommand<true>(listener, param, eventNum);
@@ -653,7 +653,7 @@ void ScriptVM::execMethodCommon(op_parmNum_t param)
Listener *const listener = a.listenerValue();
if (!listener) {
m_VMStack.GetTop().Clear();
throw ScriptException("command '%s' applied to NULL listener", Event::GetEventName(eventNum).c_str());
throw ScriptException("command '%s' applied to NULL listener", Event::GetEventName(eventNum));
}
executeCommand<true, true>(listener, param, eventNum);