Use move construct for large data

This commit is contained in:
Chocobo1
2023-07-01 13:47:15 +08:00
parent 8655e48336
commit 715a4f3eb6
2 changed files with 3 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ void PortForwarderImpl::setPorts(const QString &profile, QSet<quint16> ports)
{
const QSet<quint16> oldForwardedPorts = std::accumulate(m_portProfiles.cbegin(), m_portProfiles.cend(), QSet<quint16>());
m_portProfiles[profile] = ports;
m_portProfiles[profile] = std::move(ports);
const QSet<quint16> newForwardedPorts = std::accumulate(m_portProfiles.cbegin(), m_portProfiles.cend(), QSet<quint16>());
m_provider->removeMappedPorts(oldForwardedPorts - newForwardedPorts);