Projects > cpp > Issues > Refactor #2127

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Adding CCLOG before original path is returned in CCFileUtils::fullPathForFileName to aid in debugging

Refactor #2127 [Closed]
dumganhar 2013-05-07 08:40 . Updated over 11 years ago

Fixed at https://github.com/cocos2d/cocos2d-x/pull/2422.
The PR has fix two issues:
1) Added additional CCLOG to CCFileUtils::fullPathForFilename:
There’s currently no way to be sure, from a calling function, that
fullPathForFilename has returned an invalid file path, which makes it
difficult to quickly track down missing, or incorrect file paths. Added
a CCLOG before the original string is returned to make debugging
missing or incorrect file paths easier.

2) Optmization to ccArrayGetIndexOfObject …
Optimized loop of ccArrayGetIndexOfObject to remove the overhead of 3
pointer dereferences per iteration, and pre-increment the int for
speed. If this function is called a lot, and with a large list, this
will result in a good performance win.
This can probably be done with just pointers, but I haven’t taken the
time to validate all function calls to make sure it would be
appropriate. Though I can guarantee that if this worked fine before, it
will work fine with this change.

dumganhar 2013-05-07 11:52
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:30bca4ef419ff8006e8b511da51e25a4f4a4c708.

Atom PDF

Status:Closed
Start date:2013-05-07
Priority:Normal
Due date:
Assignee:dumganhar
% Done:

100%

Category:all
Target version:2.1.4