Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf37dfc

Browse files
committed
Change IS_LITTLE_ENDIAN macro -- a little faster now.
1 parent ad98db1 commit cf37dfc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/longobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ PyLong_AsVoidPtr(PyObject *vv)
562562
* rewritten to use the newer PyLong_{As,From}ByteArray API.
563563
*/
564564

565-
#define IS_LITTLE_ENDIAN *(char*)&one != '\0'
565+
#define IS_LITTLE_ENDIAN (int)*(unsigned char*)&one
566566

567567
/* Create a new long int object from a C LONG_LONG int. */
568568

0 commit comments

Comments
 (0)