Skip to content

Commit a85e02d

Browse files
refactor: remove LONG_MAX check
1 parent 5142b3d commit a85e02d

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

msgpack/unpack.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ static inline int unpack_callback_uint32(unpack_user* u, uint32_t d, msgpack_unp
7070

7171
static inline int unpack_callback_uint64(unpack_user* u, uint64_t d, msgpack_unpack_object* o)
7272
{
73-
PyObject *p;
74-
if (d > LONG_MAX) {
75-
p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d);
76-
} else {
77-
p = PyLong_FromLong((long)d);
78-
}
73+
PyObject *p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d);
7974
if (!p)
8075
return -1;
8176
*o = p;

0 commit comments

Comments
 (0)