1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:04:47 +02:00

Revert "Optimise the maths for the jsonrpc oversize integer workaround".

This reverts commit 937404e311.
This commit is contained in:
Sadie Powell
2025-05-30 18:08:32 +01:00
parent 76f0c78ece
commit b724617a8d
+4 -2
View File
@@ -239,7 +239,8 @@ yyjson_mut_val *JSONRPCServiceInterface::SerializeElement(yyjson_mut_doc *doc, c
},
[&doc, &elem](int64_t i)
{
if (std::abs(i) < (1LL << integer_bits))
auto bits = std::floor(std::log2(abs(i))) + 1;
if (bits <= integer_bits)
{
// We can fit this into an integer.
elem = yyjson_mut_int(doc, i);
@@ -253,7 +254,8 @@ yyjson_mut_val *JSONRPCServiceInterface::SerializeElement(yyjson_mut_doc *doc, c
},
[&doc, &elem](uint64_t u)
{
if (u < (1ULL << integer_bits))
auto bits = std::floor(std::log2(u)) + 1;
if (bits <= integer_bits)
{
// We can fit this into an integer.
elem = yyjson_mut_uint(doc, u);