mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd: minor simplifications; minor cleanup.
This commit is contained in:
parent
dc2346a753
commit
bd1a66e608
3 changed files with 7 additions and 10 deletions
13
ircd/json.cc
13
ircd/json.cc
|
@ -324,17 +324,14 @@ ircd::string_view
|
|||
ircd::json::stringify(mutable_buffer &head,
|
||||
const iov &iov)
|
||||
{
|
||||
const auto num{iov.size()};
|
||||
const member *m[num];
|
||||
|
||||
size_t i(0);
|
||||
std::for_each(std::begin(iov), std::end(iov), [&i, &m]
|
||||
(const auto &member)
|
||||
const member *m[iov.size()];
|
||||
std::transform(std::begin(iov), std::end(iov), m, []
|
||||
(const member &m)
|
||||
{
|
||||
m[i++] = &member;
|
||||
return &m;
|
||||
});
|
||||
|
||||
return stringify(head, m, m + num);
|
||||
return stringify(head, m, m + iov.size());
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
@ -726,7 +726,7 @@ ircd::b64decode(const mutable_raw_buffer &out,
|
|||
std::distance(begin(out), e)
|
||||
};
|
||||
|
||||
assert(len <= size(out));
|
||||
assert(size_t(len) <= size(out));
|
||||
return { data(out), size_t(len) };
|
||||
}
|
||||
|
||||
|
|
|
@ -836,7 +836,7 @@ noexcept try
|
|||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
log::error("socket(%p): async handler: unhandled user exception: %s",
|
||||
log::error("socket(%p): async handler: unhandled exception: %s",
|
||||
this,
|
||||
e.what());
|
||||
|
||||
|
|
Loading…
Reference in a new issue