Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: remove LONG_MAX check
  • Loading branch information
KowalskiThomas committed Apr 20, 2026
commit a85e02d6a69d51a070fb854ae399ae41f2480ae4
7 changes: 1 addition & 6 deletions msgpack/unpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,7 @@ static inline int unpack_callback_uint32(unpack_user* u, uint32_t d, msgpack_unp

static inline int unpack_callback_uint64(unpack_user* u, uint64_t d, msgpack_unpack_object* o)
{
PyObject *p;
if (d > LONG_MAX) {
p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d);
} else {
p = PyLong_FromLong((long)d);
}
PyObject *p = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)d);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, but it seems correct.

(I am not really familiar with the C api.)

if (!p)
return -1;
*o = p;
Expand Down
Loading