mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-26 01:53:47 +00:00
As suggested, extract strlen calls from sizes into variables so it isn't called twice
This commit is contained in:
parent
eab086e184
commit
47d5b6ead7
33 changed files with 171 additions and 114 deletions
|
|
@ -288,8 +288,9 @@ bool EventManager::subscribe(SimObject *callbackObj, const char* event, const ch
|
|||
}
|
||||
else
|
||||
{
|
||||
cb = new char[dStrlen(callback) + 1];
|
||||
dStrcpy(cb, callback, dStrlen(callback) + 1);
|
||||
dsize_t cbLen = dStrlen(callback) + 1;
|
||||
cb = new char[cbLen];
|
||||
dStrcpy(cb, callback, cbLen);
|
||||
}
|
||||
|
||||
// Create the subscriber object.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue