mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
friendship with std::unordered_map is now over, std::map is my new best friend
This commit is contained in:
parent
c7c6905e1e
commit
723351eb4e
1 changed files with 4 additions and 6 deletions
|
@ -104,11 +104,7 @@ namespace llarp
|
|||
{
|
||||
huint32_t found = {0};
|
||||
KeyMap_t::iterator itr = m_KeyToIP.find(pk);
|
||||
if(itr != m_KeyToIP.end())
|
||||
{
|
||||
found.h = itr->second.h;
|
||||
}
|
||||
else
|
||||
if(itr == m_KeyToIP.end())
|
||||
{
|
||||
// allocate and map
|
||||
found = AllocateNewAddress();
|
||||
|
@ -122,11 +118,13 @@ namespace llarp
|
|||
llarp::LogError(Name(), "failed to map ", found, " to ", pk);
|
||||
return found;
|
||||
}
|
||||
if(m_KeyToIP.find(pk) != m_KeyToIP.end())
|
||||
if(m_KeyToIP.count(pk))
|
||||
llarp::LogInfo(Name(), " mapping ", pk, " to ", found);
|
||||
else
|
||||
llarp::LogError(Name(), "failed to map ", pk, " to ", found);
|
||||
}
|
||||
else
|
||||
found.h = itr->second.h;
|
||||
|
||||
MarkIPActive(found);
|
||||
|
||||
|
|
Loading…
Reference in a new issue