Commit 1494819b authored by Anton Gladky's avatar Anton Gladky
Browse files

Use unordered_map instead of map for MapId2IntrT

find() function should search there in O(1) time
instead of O(lg(n))
parent 78845a1b
......@@ -14,6 +14,9 @@
#include "State.hpp"
#include "Material.hpp"
#include <unordered_map>
#include <boost/serialization/unordered_map.hpp>
#include <lib/base/Math.hpp>
#include <lib/serialization/Serializable.hpp>
#include <lib/multimethods/Indexable.hpp>
......@@ -26,7 +29,7 @@ class Body: public Serializable{
// numerical types for storing ids
using id_t = int ;
// internal structure to hold some interaction of a body; used by InteractionContainer;
using MapId2IntrT = std::map<Body::id_t, shared_ptr<Interaction> >;
using MapId2IntrT = std::unordered_map<Body::id_t, shared_ptr<Interaction> >;
// groupMask type
// bits for Body::flags
......
......@@ -97,7 +97,6 @@ class FunctorWrapper //: public Serializable // FIXME functor shouldn't be seria
{
private :
typedef Loki::FunctorImpl<ResultType, ArgumentTypeList > Impl;
typedef ArgumentTypeList ParmList;
typedef typename Impl::Parm1 Parm1;
typedef typename Impl::Parm2 Parm2;
typedef typename Impl::Parm3 Parm3;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment