Skip to content

Commit 9c511b1

Browse files
committed
Tweak comments, fix PEP-7 formatting
1 parent e6ef5e1 commit 9c511b1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Objects/longobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6453,12 +6453,14 @@ int_from_bytes_impl(PyTypeObject *type, PyObject *bytes_obj,
64536453
return NULL;
64546454
}
64556455

6456-
/* Use buffer protocol to avoid copies. */
6456+
/* Fast-path exact bytes. */
64576457
if (PyBytes_CheckExact(bytes_obj)) {
64586458
long_obj = _PyLong_FromByteArray(
64596459
(unsigned char *)PyBytes_AS_STRING(bytes_obj), Py_SIZE(bytes_obj),
64606460
little_endian, is_signed);
6461-
} else if (PyObject_CheckBuffer(bytes_obj)) {
6461+
}
6462+
/* Use buffer protocol to avoid copies. */
6463+
else if (PyObject_CheckBuffer(bytes_obj)) {
64626464
if (PyObject_GetBuffer(bytes_obj, &view, PyBUF_SIMPLE) != 0) {
64636465
return NULL;
64646466
}

0 commit comments

Comments
 (0)