1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-11 13:27:52 +00:00

eliminate extra copy

This commit is contained in:
orignal 2017-02-06 12:50:54 -05:00
parent d96dbe9365
commit d2edbfd6fa

View File

@ -203,7 +203,8 @@ namespace tunnel
{
m_Buffer.CompleteCurrentTunnelDataMessage ();
std::vector<std::shared_ptr<I2NPMessage> > newTunnelMsgs;
for (auto& tunnelMsg : m_Buffer.GetTunnelDataMsgs ())
const auto& tunnelDataMsgs = m_Buffer.GetTunnelDataMsgs ();
for (auto& tunnelMsg : tunnelDataMsgs)
{
auto newMsg = CreateEmptyTunnelDataMsg ();
m_Tunnel->EncryptTunnelMsg (tunnelMsg, newMsg);