0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd:Ⓜ️:request: Minor simplify.

This commit is contained in:
Jason Volk 2020-10-03 02:22:42 -07:00
parent bdf3e0a126
commit bfaf21807b

View file

@ -174,11 +174,16 @@ const
size_t(generate_content_max)
};
if(unlikely(json::serialized(*this) > buffer::size(buf)))
const auto serial_size
{
json::serialized(*this)
};
if(unlikely(serial_size > buffer::size(buf)))
throw m::error
{
"M_REQUEST_TOO_LARGE", "This server generated a request of %zu bytes; limit is %zu",
json::serialized(*this),
serial_size,
buffer::size(buf)
};