Skip to content

Commit

Permalink
Replace 'for_each' with 'transform'
Browse files Browse the repository at this point in the history
  • Loading branch information
melvo committed Mar 11, 2024
1 parent 2a9614e commit ce4f61f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/QXmppMixManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ QXmppTask<QXmppMixManager::ChannelNodeResult> QXmppMixManager::requestChannelNod
return std::move(*error);
} else {
const auto &items = std::get<QList<QXmppDiscoveryIq::Item>>(result);
QVector<QString> nodes;
QVector<QString> nodes(items.size());

std::for_each(items.cbegin(), items.cend(), [&nodes](const QXmppDiscoveryIq::Item &item) {
nodes.append(item.node());
std::transform(items.cbegin(), items.cend(), nodes.begin(), [](const QXmppDiscoveryIq::Item &item) {
return item.node();
});

return std::move(QXmppMixIq::listToNodes(nodes));
Expand Down

0 comments on commit ce4f61f

Please sign in to comment.