As suggested, extract strlen calls from sizes into variables so it isn't called twice

This commit is contained in:
Glenn Smith 2018-03-08 20:59:40 -05:00
parent eab086e184
commit 47d5b6ead7
33 changed files with 171 additions and 114 deletions

View file

@ -1575,8 +1575,9 @@ const char* DInputDevice::getJoystickAxesString()
}
}
char* returnString = Con::getReturnBuffer( dStrlen( buf ) + 1 );
dStrcpy( returnString, buf, dStrlen(buf) + 1 );
dsize_t returnLen = dStrlen(buf) + 1;
char* returnString = Con::getReturnBuffer(returnLen);
dStrcpy( returnString, buf, returnLen );
return( returnString );
}