Replaced for-loop with std::transform.
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
57ec1fd23a
commit
ff0bd7b906
|
@ -20,11 +20,13 @@
|
||||||
#include <codecvt>
|
#include <codecvt>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
#include "mastodon-cpp.hpp"
|
#include "mastodon-cpp.hpp"
|
||||||
|
|
||||||
using namespace Mastodon;
|
using namespace Mastodon;
|
||||||
|
|
||||||
return_base::operator bool()
|
return_base::operator bool()
|
||||||
{
|
{
|
||||||
if (error_code == 0)
|
if (error_code == 0)
|
||||||
|
@ -166,11 +168,13 @@ const curlpp::Forms API::maptoformdata(const parametermap &map)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (const string &str : it.second)
|
std::transform(it.second.begin(), it.second.end(),
|
||||||
{
|
std::back_inserter(formdata),
|
||||||
formdata.push_back(
|
[&it](const string &s)
|
||||||
new curlpp::FormParts::Content(it.first + "[]", str));
|
{
|
||||||
}
|
return new curlpp::FormParts::Content
|
||||||
|
(it.first + "[]", s);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue