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
|
|
@ -547,8 +547,9 @@ const char * Component::getDescriptionText(const char *desc)
|
|||
// [tom, 1/12/2007] If it isn't a file, just do it the easy way
|
||||
if (!Platform::isFile(desc))
|
||||
{
|
||||
newDesc = new char[dStrlen(desc) + 1];
|
||||
dStrcpy(newDesc, desc, dStrlen(desc) + 1);
|
||||
dsize_t newDescLen = dStrlen(desc) + 1;
|
||||
newDesc = new char[newDescLen];
|
||||
dStrcpy(newDesc, desc, newDescLen);
|
||||
|
||||
return newDesc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue