mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-16 10:03:14 -07:00
Reduce memory use and a bit of cleanup.
This commit is contained in:
parent
9e80db0fd1
commit
62578a2162
4 changed files with 67 additions and 43 deletions
|
@ -99,9 +99,9 @@ public:
|
|||
Mutex::Lock _l(_networks_m);
|
||||
std::unordered_map<uint64_t,_NW>::const_iterator i(_networks.find(networkId));
|
||||
if (i != _networks.end()) {
|
||||
for(std::unordered_map<uint64_t,nlohmann::json>::const_iterator m(i->second.members.begin());m!=i->second.members.end();++m) {
|
||||
for(std::unordered_map< uint64_t,std::vector<uint8_t> >::const_iterator m(i->second.members.begin());m!=i->second.members.end();++m) {
|
||||
try {
|
||||
func(networkId,m->first,m->second);
|
||||
func(networkId,m->first,nlohmann::json::from_msgpack(m->second));
|
||||
} catch ( ... ) {}
|
||||
}
|
||||
}
|
||||
|
@ -126,10 +126,10 @@ private:
|
|||
struct _NW
|
||||
{
|
||||
_NW() : summaryInfoLastComputed(0) {}
|
||||
nlohmann::json config;
|
||||
std::vector<uint8_t> config;
|
||||
NetworkSummaryInfo summaryInfo;
|
||||
uint64_t summaryInfoLastComputed;
|
||||
std::unordered_map<uint64_t,nlohmann::json> members;
|
||||
std::unordered_map< uint64_t,std::vector<uint8_t> > members;
|
||||
};
|
||||
|
||||
std::unordered_map<uint64_t,_NW> _networks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue