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 ed10ce2511
commit 6b024b21bf
33 changed files with 171 additions and 114 deletions

View file

@ -167,8 +167,9 @@ bool guiAnimBitmapCtrl::ptSetFrameRanges(void *object, const char *index, const
pData->mCurFrameIndex = pData->mNumFrames;
return true;
}
char* tokCopy = new char[dStrlen(data) + 1];
dStrcpy(tokCopy, data, dStrlen(data) + 1);
dsize_t tokLen = dStrlen(data) + 1;
char* tokCopy = new char[tokLen];
dStrcpy(tokCopy, data, tokLen);
char* currTok = dStrtok(tokCopy, " \t");
while (currTok != NULL)