Skip to content

Commit fb89cd9

Browse files
committed
Replace is_tagged_int with PyStackRef_IsTaggedInt
1 parent d84cd2d commit fb89cd9

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Include/internal/pycore_stackref.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ _PyStackRef_FromPyObjectImmortal(PyObject *obj, const char *filename, int linenu
136136
#define PyStackRef_FromPyObjectImmortal(obj) _PyStackRef_FromPyObjectImmortal(_PyObject_CAST(obj), __FILE__, __LINE__)
137137

138138
static inline bool
139-
is_tagged_int(_PyStackRef ref)
139+
PyStackRef_IsTaggedInt(_PyStackRef ref)
140140
{
141141
return (ref.index & 1) == 1;
142142
}
143143

144144
static inline void
145145
_PyStackRef_CLOSE(_PyStackRef ref, const char *filename, int linenumber)
146146
{
147-
if (is_tagged_int(ref)) {
147+
if (PyStackRef_IsTaggedInt(ref)) {
148148
return;
149149
}
150150
PyObject *obj = _Py_stackref_close(ref, filename, linenumber);
@@ -166,7 +166,7 @@ _PyStackRef_XCLOSE(_PyStackRef ref, const char *filename, int linenumber)
166166
static inline _PyStackRef
167167
_PyStackRef_DUP(_PyStackRef ref, const char *filename, int linenumber)
168168
{
169-
if (ref.index & 1) {
169+
if (PyStackRef_IsTaggedInt(ref)) {
170170
return ref;
171171
}
172172
else {

Python/stackrefs.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,11 @@ _PyStackRef PyStackRef_TagInt(intptr_t i)
205205
intptr_t
206206
PyStackRef_UntagInt(_PyStackRef i)
207207
{
208-
assert(is_tagged_int(i));
208+
assert(PyStackRef_IsTaggedInt(i));
209209
intptr_t val = (intptr_t)i.index;
210210
return Py_ARITHMETIC_RIGHT_SHIFT(intptr_t, val, 1);
211211
}
212212

213-
bool PyStackRef_IsTaggedInt(_PyStackRef ref)
214-
{
215-
return is_tagged_int(ref);
216-
}
217-
218213
bool
219214
PyStackRef_IsNullOrInt(_PyStackRef ref)
220215
{

0 commit comments

Comments
 (0)