We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Potential hash collision by using typeid(T).hash_code() in JSB and LuaBinding
Potential hash collision by using typeid(T).hash_code() in JSB and LuaBinding
Bug #3463 [Closed]
Instead of using
std::unordered_map<long, T>
(long is the hash_code generated bytypeid(T).hash_code()
),We needs to use
std::unordered_map<std::string, T>
to avoid collision sinceunordered_map
internally processes collisions.