Skip to content

Commit 24a0d2a

Browse files
KRRT7eendebakpt
andauthored
Update Include/internal/pycore_long.h
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
1 parent 5e01840 commit 24a0d2a

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Include/internal/pycore_long.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,10 @@ static inline int
363363
_PyLong_FitsInt64(const PyLongObject *v)
364364
{
365365
uintptr_t tag = v->long_value.lv_tag;
366-
if (tag < (2 << NON_SIZE_BITS)) {
367-
return 1;
366+
if (tag < (_PY_LONG_MAX_DIGITS_FOR_INT64 << NON_SIZE_BITS)) {
367+
return 1;
368368
}
369369
Py_ssize_t ndigits = (Py_ssize_t)(tag >> NON_SIZE_BITS);
370-
if (ndigits < _PY_LONG_MAX_DIGITS_FOR_INT64) {
371-
return 1;
372-
}
373370
if (ndigits > _PY_LONG_MAX_DIGITS_FOR_INT64) {
374371
return 0;
375372
}

0 commit comments

Comments
 (0)