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
|
|
@ -39,8 +39,9 @@ void GFXVideoMode::parseFromString( const char *str )
|
|||
return;
|
||||
|
||||
// Copy the string, as dStrtok is destructive
|
||||
char *tempBuf = new char[dStrlen( str ) + 1];
|
||||
dStrcpy( tempBuf, str, dStrlen(str) + 1 );
|
||||
dsize_t tempBufLen = dStrlen(str) + 1;
|
||||
char *tempBuf = new char[tempBufLen];
|
||||
dStrcpy( tempBuf, str, tempBufLen );
|
||||
|
||||
#define PARSE_ELEM(type, var, func, tokParam, sep) \
|
||||
if(const char *ptr = dStrtok( tokParam, sep)) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue