0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️ Use vector_view here.

This commit is contained in:
Jason Volk 2018-03-14 15:56:49 -07:00
parent 68b5d53ae8
commit 2e9ef15cf5
2 changed files with 7 additions and 8 deletions

View file

@ -28,7 +28,7 @@ struct ircd::m::txn
json::property<name::pdus, json::array>
>
{
using array = std::pair<const json::value *, size_t>;
using array = vector_view<const json::value>;
static string_view create_id(const mutable_buffer &out, const string_view &txn);
static std::string create(const array &pdu, const array &edu, const array &pdu_failure = {});

View file

@ -1193,25 +1193,25 @@ ircd::m::txn::create(const array &pdu,
const json::iov::add_if _pdus
{
iov, pdu.second,
iov, !empty(pdu),
{
"pdus", { pdu.first, pdu.second }
"pdus", { data(pdu), size(pdu) }
}
};
const json::iov::add_if _edus
{
iov, edu.second,
iov, !empty(edu),
{
"edus", { edu.first, edu.second }
"edus", { data(edu), size(edu) }
}
};
const json::iov::add_if _pdu_failures
{
iov, pdu_failure.second,
iov, !empty(pdu_failure),
{
"pdu_failures", { pdu_failure.first, pdu_failure.second }
"pdu_failures", { data(pdu_failure), size(pdu_failure) }
}
};
@ -1403,7 +1403,6 @@ const
return true;
}
//
// hook::site
//