Skip to content

Commit c9edd32

Browse files
committed
move _long_is_small_int
1 parent 19cbe69 commit c9edd32

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Objects/longobject.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ _Py_DECREF_INT(PyLongObject *op)
4848
_Py_DECREF_SPECIALIZED((PyObject *)op, _PyLong_ExactDealloc);
4949
}
5050

51+
static inline int
52+
/// Return 1 if the object is one of the immortal small ints
53+
_long_is_small_int(PyObject *op)
54+
{
55+
PyLongObject *long_object = (PyLongObject *)op;
56+
int is_small_int = (long_object->long_value.lv_tag & IMMORTALITY_BIT_MASK) != 0;
57+
assert((!is_small_int) || PyLong_CheckExact(op));
58+
return is_small_int;
59+
}
60+
5161
static inline int
5262
is_medium_int(stwodigits x)
5363
{
@@ -3622,16 +3632,6 @@ long_richcompare(PyObject *self, PyObject *other, int op)
36223632
Py_RETURN_RICHCOMPARE(result, 0, op);
36233633
}
36243634

3625-
static inline int
3626-
/// Return 1 if the object is one of the immortal small ints
3627-
_long_is_small_int(PyObject *op)
3628-
{
3629-
PyLongObject *long_object = (PyLongObject *)op;
3630-
int is_small_int = (long_object->long_value.lv_tag & IMMORTALITY_BIT_MASK) != 0;
3631-
assert((!is_small_int) || PyLong_CheckExact(op));
3632-
return is_small_int;
3633-
}
3634-
36353635
void
36363636
_PyLong_ExactDealloc(PyObject *self)
36373637
{

0 commit comments

Comments
 (0)