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