Simplify PyObject creation in unpack_callback_int64

Refactor unpack_callback_int64 to simplify PyObject creation.
This commit is contained in:
Inada Naoki 2026-04-21 18:09:04 +09:00 committed by GitHub
parent 1e28db75ba
commit 77f5a53834
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,11 +98,6 @@ static inline int unpack_callback_int8(unpack_user* u, int8_t d, msgpack_unpack_
static inline int unpack_callback_int64(unpack_user* u, int64_t d, msgpack_unpack_object* o)
{
PyObject *p;
if (d > LONG_MAX || d < LONG_MIN) {
p = PyLong_FromLongLong((PY_LONG_LONG)d);
} else {
p = PyLong_FromLong((long)d);
PyObject *p = PyLong_FromLongLong((PY_LONG_LONG)d);
if (!p)
return -1;