Use a a loop instead of std::trasform as suggested by Cyril

This commit is contained in:
Gioacchino Mazzurco 2020-04-12 22:46:58 +02:00
parent 37854c8f23
commit f54fb046e4
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -43,7 +43,7 @@
#include "retroshare/rstypes.h"
#include "retroshare/rspeers.h"
#include "retroshare/rsinit.h"
#include "util/cxx17retrocompat.h"
#include "rsitems/rsfiletransferitems.h"
#include "rsitems/rsserviceids.h"
#include "util/rsmemory.h"
@ -1975,9 +1975,8 @@ void ftServer::ftReceiveSearchResult(RsTurtleFTSearchResultItem *item)
hasCallback = true;
std::vector<TurtleFileInfoV2> cRes;
std::transform( item->result.begin(), item->result.end(),
std::back_inserter(cRes),
[](const auto& it){ return TurtleFileInfoV2(it); } );
for(auto& res: std::as_const(item->result))
cRes.push_back(TurtleFileInfoV2(res));
cbpt->second.first(cRes);
}