mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Optimized event name
Use a static char*, instead of an allocated str
This commit is contained in:
parent
e8d2a2a461
commit
47a3c0bf55
7 changed files with 99 additions and 80 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue