Skip to content

Commit 068a16a

Browse files
Apply suggestions from code review
Co-authored-by: Mark Shannon <[email protected]>
1 parent 878207a commit 068a16a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Include/internal/pycore_long.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
157157

158158
/* Long value tag bits:
159159
* 0-1: Sign bits value = (1-sign), ie. negative=2, positive=0, zero=1.
160-
* 2: Reserved for immortality bit. Set to 1 for the small ints
160+
* 2: Set to 1 for the small ints
161161
* 3+ Unsigned digit count
162162
*/
163163
#define SIGN_MASK 3

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3617,7 +3617,7 @@ _long_is_small_int(PyObject *op)
36173617
{
36183618
PyLongObject *long_object = (PyLongObject *)op;
36193619

3620-
return (int)(long_object->long_value.lv_tag & IMMORTALITY_BIT_MASK);
3620+
return (long_object->long_value.lv_tag & IMMORTALITY_BIT_MASK) != 0;
36213621
}
36223622

36233623
static void

0 commit comments

Comments
 (0)