mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Use std::as_const (C++17 feature)
This commit is contained in:
@@ -91,7 +91,7 @@ namespace BlackMisc
|
||||
|
||||
if (!m_duplex) { return; }
|
||||
|
||||
for (const auto &filter : as_const(getChannel(channel).peerSubscriptions))
|
||||
for (const auto &filter : std::as_const(getChannel(channel).peerSubscriptions))
|
||||
{
|
||||
if (filter.matches(param))
|
||||
{
|
||||
@@ -103,7 +103,7 @@ namespace BlackMisc
|
||||
|
||||
void CDataLinkDBus::handlePeerEvent(const QString &channel, const CVariant ¶m)
|
||||
{
|
||||
for (const auto &observerWeak : as_const(getChannel(channel).passiveObservers))
|
||||
for (const auto &observerWeak : std::as_const(getChannel(channel).passiveObservers))
|
||||
{
|
||||
auto observer = observerWeak.lock();
|
||||
if (observer && observer->eventSubscription().matches(param))
|
||||
@@ -124,7 +124,7 @@ namespace BlackMisc
|
||||
void CDataLinkDBus::announceLocalSubscriptions(const QString &channel)
|
||||
{
|
||||
CVariantList filters;
|
||||
for (const auto &observerWeak : as_const(getChannel(channel).passiveObservers))
|
||||
for (const auto &observerWeak : std::as_const(getChannel(channel).passiveObservers))
|
||||
{
|
||||
auto observer = observerWeak.lock();
|
||||
if (observer) { filters.push_back(observer->eventSubscription()); }
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace BlackMisc
|
||||
|
||||
void CDataLinkLocal::dispatchEvent(const CVariant ¶m, const QString &channel)
|
||||
{
|
||||
for (const auto &observerWeak : as_const(getChannel(channel).passiveObservers))
|
||||
for (const auto &observerWeak : std::as_const(getChannel(channel).passiveObservers))
|
||||
{
|
||||
auto observer = observerWeak.lock();
|
||||
if (observer && observer->eventSubscription().matches(param))
|
||||
|
||||
Reference in New Issue
Block a user