use _network function to reduce source code complexity
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user