Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rémi Cailletaud
yade
Commits
1494819b
Commit
1494819b
authored
Jun 07, 2016
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/Body.hpp
View file @
1494819b
...
...
@@ -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
...
...
lib/multimethods/FunctorWrapper.hpp
View file @
1494819b
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment