use _network function to reduce source code complexity
This commit is contained in:
parent
2b04ac5e9b
commit
787608b568
2 changed files with 16 additions and 11 deletions
|
@ -158,12 +158,7 @@ public:
|
|||
inline SharedPtr<Network> network(uint64_t nwid) const
|
||||
{
|
||||
Mutex::Lock _l(_networks_m);
|
||||
std::vector< SharedPtr<Network> >::const_iterator iter = std::lower_bound(_networks.begin(), _networks.end(), nwid, NetworkComparator());
|
||||
if(iter != _networks.end() && (*iter)->id() == nwid) {
|
||||
return *iter;
|
||||
} else {
|
||||
return SharedPtr<Network>();
|
||||
}
|
||||
return _network(nwid);
|
||||
}
|
||||
|
||||
inline std::vector< SharedPtr<Network> > allNetworks() const
|
||||
|
@ -217,6 +212,16 @@ private:
|
|||
}
|
||||
};
|
||||
|
||||
inline SharedPtr<Network> _network(uint64_t nwid) const
|
||||
{
|
||||
std::vector< SharedPtr<Network> >::const_iterator iter = std::lower_bound(_networks.begin(), _networks.end(), nwid, NetworkComparator());
|
||||
if(iter != _networks.end() && (*iter)->id() == nwid) {
|
||||
return *iter;
|
||||
} else {
|
||||
return SharedPtr<Network>();
|
||||
}
|
||||
}
|
||||
|
||||
RuntimeEnvironment _RR;
|
||||
RuntimeEnvironment *RR;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue