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

@ -446,8 +446,9 @@ bool afxMagicMissileData::onAdd()
Vector<char*> dataBlocks(__FILE__, __LINE__);
// make a copy of points_string
char* tokCopy = new char[dStrlen(wiggle_axis_string) + 1];
dStrcpy(tokCopy, wiggle_axis_string, dStrlen(wiggle_axis_string) + 1);
dsize_t tokCopyLen = dStrlen(wiggle_axis_string) + 1;
char* tokCopy = new char[tokCopyLen];
dStrcpy(tokCopy, wiggle_axis_string, tokCopyLen);
// extract tokens one by one, adding them to dataBlocks
char* currTok = dStrtok(tokCopy, " \t");