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

@ -594,8 +594,9 @@ bool ParticleData::preload(bool server, String &errorStr)
animTexFrames.clear();
char* tokCopy = new char[dStrlen(animTexFramesString) + 1];
dStrcpy(tokCopy, animTexFramesString, dStrlen(animTexFramesString) + 1);
dsize_t tokLen = dStrlen(animTexFramesString) + 1;
char* tokCopy = new char[tokLen];
dStrcpy(tokCopy, animTexFramesString, tokLen);
char* currTok = dStrtok(tokCopy, " \t");
while (currTok != NULL)