From 77f5a5383435007bfb94f3a7579fc6282ed46ebe Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 21 Apr 2026 18:09:04 +0900 Subject: [PATCH] Simplify PyObject creation in unpack_callback_int64 Refactor unpack_callback_int64 to simplify PyObject creation. --- msgpack/unpack.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/msgpack/unpack.h b/msgpack/unpack.h index e7121ca..0f9ffc0 100644 --- a/msgpack/unpack.h +++ b/msgpack/unpack.h @@ -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;