Skip to content
Snippets Groups Projects
Commit 3418fd14 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[ML] Make Location::op<() available for inline.

This saves 16% of instructions in the
GroundwaterFlow::init() code due to faster access
in the multi-index table.
parent 52608d14
No related branches found
No related tags found
No related merge requests found
...@@ -24,13 +24,6 @@ std::ostream& operator<<(std::ostream& os, MeshItemType const& t) ...@@ -24,13 +24,6 @@ std::ostream& operator<<(std::ostream& os, MeshItemType const& t)
return os; return os;
} }
bool operator<(const Location& left, const Location& right)
{
if (left.mesh_id != right.mesh_id) return left.mesh_id < right.mesh_id;
if (left.item_type != right.item_type) return left.item_type < right.item_type;
return left.item_id < right.item_id;
}
std::ostream& operator<<(std::ostream& os, Location const& l) std::ostream& operator<<(std::ostream& os, Location const& l)
{ {
return os << "(" << l.mesh_id return os << "(" << l.mesh_id
......
...@@ -37,7 +37,14 @@ struct Location ...@@ -37,7 +37,14 @@ struct Location
}; };
/// Lexicographic order of Location. /// Lexicographic order of Location.
bool operator<(const Location& left, const Location& right); inline
bool operator<(const Location& left, const Location& right)
{
if (left.mesh_id != right.mesh_id) return left.mesh_id < right.mesh_id;
if (left.item_type != right.item_type) return left.item_type < right.item_type;
return left.item_id < right.item_id;
}
std::ostream& operator<<(std::ostream& os, Location const& l); std::ostream& operator<<(std::ostream& os, Location const& l);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment