About passing args by reference in CCMutableDictionary

About passing args by reference in CCMutableDictionary
0.0 0


CCTextureCache have specialization of CCMutableDictionary as member

@ CCMutableDictionary<std::string, CCTexture2D*> * m_pTextures; @

CCMutableDictionary have methods
_ValueT objectForKey(_T key); bool setObject(_ValueT pObject, _T key); void removeObjectForKey(_T key);

Which specialized into:
CCTexture2D* objectForKey(std::string key); bool setObject(CCTexture2D* pObject, std::string key); void removeObjectForKey(std::string key);

Passing std::string by copy instead const reference??? Awfully… :frowning:


Thanks for your pull request. It has been merge into master repo now.
I believe there’re still many structure->reference parameter can be optimized in the engine, but… so lazy I’m, hehe, sorry.
I may re-check them in the 1.0.0 upgrading work.


Can’t wait for 1.0.0 :slight_smile: Look at https://github.com/cocos2d/cocos2d-x/pull/474


hey, thank you for your work, it will make the cocos2d-x community more stronger,