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
ed10ce2511
commit
6b024b21bf
33 changed files with 171 additions and 114 deletions
|
|
@ -2340,8 +2340,9 @@ static int Sc_ScanString(int ret)
|
|||
if (!collapseEscape(CMDtext + 1))
|
||||
return -1;
|
||||
|
||||
char* buffer = (char*)consoleAlloc(dStrlen(CMDtext));
|
||||
dStrcpy(buffer, CMDtext + 1, dStrlen(CMDtext));
|
||||
dsize_t bufferLen = dStrlen(CMDtext);
|
||||
char* buffer = (char*)consoleAlloc(bufferLen);
|
||||
dStrcpy(buffer, CMDtext + 1, bufferLen);
|
||||
|
||||
CMDlval.str = MakeToken< char* >(buffer, lineIndex);
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue