Skip to content

Commit 86aa269

Browse files
orenmnmdickinson
authored andcommitted
remove 3 redundant casts in Objects/longobject.c (#445)
1 parent 2225dda commit 86aa269

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Objects/longobject.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ PyLong_FromUnsignedLong(unsigned long ival)
316316
if (ival < PyLong_BASE)
317317
return PyLong_FromLong(ival);
318318
/* Count the number of Python digits. */
319-
t = (unsigned long)ival;
319+
t = ival;
320320
while (t) {
321321
++ndigits;
322322
t >>= PyLong_SHIFT;
@@ -854,7 +854,7 @@ _PyLong_FromByteArray(const unsigned char* bytes, size_t n,
854854
/* Because we're going LSB to MSB, thisbyte is
855855
more significant than what's already in accum,
856856
so needs to be prepended to accum. */
857-
accum |= (twodigits)thisbyte << accumbits;
857+
accum |= thisbyte << accumbits;
858858
accumbits += 8;
859859
if (accumbits >= PyLong_SHIFT) {
860860
/* There's enough to fill a Python digit. */
@@ -1121,7 +1121,7 @@ PyLong_FromUnsignedLongLong(unsigned long long ival)
11211121
if (ival < PyLong_BASE)
11221122
return PyLong_FromLong((long)ival);
11231123
/* Count the number of Python digits. */
1124-
t = (unsigned long long)ival;
1124+
t = ival;
11251125
while (t) {
11261126
++ndigits;
11271127
t >>= PyLong_SHIFT;

0 commit comments

Comments
 (0)