mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +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
|
|
@ -238,10 +238,11 @@ StrConstNode *StrConstNode::alloc(S32 lineNumber, char *str, bool tag, bool doc)
|
|||
StrConstNode *ret = (StrConstNode *)consoleAlloc(sizeof(StrConstNode));
|
||||
constructInPlace(ret);
|
||||
ret->dbgLineNumber = lineNumber;
|
||||
ret->str = (char *)consoleAlloc(dStrlen(str) + 1);
|
||||
dsize_t retStrLen = dStrlen(str) + 1;
|
||||
ret->str = (char *)consoleAlloc(retStrLen);
|
||||
ret->tag = tag;
|
||||
ret->doc = doc;
|
||||
dStrcpy(ret->str, str, dStrlen(str) + 1);
|
||||
dStrcpy(ret->str, str, retStrLen);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue