mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T280, clients as callsign map as this is faster
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
|
||||
#include "clientlist.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Network
|
||||
@@ -28,5 +30,15 @@ namespace BlackMisc
|
||||
if (this->isEmpty()) { return static_cast<CClient::Capabilities>(CClient::None); }
|
||||
return this->findFirstByCallsign(callsign).getCapabilities();
|
||||
}
|
||||
|
||||
QMap<CCallsign, CClient> CClientList::asMap() const
|
||||
{
|
||||
QMap<CCallsign, CClient> map;
|
||||
for (const CClient &client : *this)
|
||||
{
|
||||
map.insert(client.getCallsign(), client);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user