]> granicus.if.org Git - python/commitdiff
remove 3 redundant casts in Objects/longobject.c (#445)
authororenmn <orenmn@gmail.com>
Mon, 6 Mar 2017 08:42:47 +0000 (10:42 +0200)
committerMark Dickinson <mdickinson@enthought.com>
Mon, 6 Mar 2017 08:42:47 +0000 (08:42 +0000)
Objects/longobject.c

index 6c476020775214f47effcd73bd717710b6150131..6a5bc47ebc94970bcbccc8d1ddf7c0a27557c910 100644 (file)
@@ -316,7 +316,7 @@ PyLong_FromUnsignedLong(unsigned long ival)
     if (ival < PyLong_BASE)
         return PyLong_FromLong(ival);
     /* Count the number of Python digits. */
-    t = (unsigned long)ival;
+    t = ival;
     while (t) {
         ++ndigits;
         t >>= PyLong_SHIFT;
@@ -854,7 +854,7 @@ _PyLong_FromByteArray(const unsigned char* bytes, size_t n,
             /* Because we're going LSB to MSB, thisbyte is
                more significant than what's already in accum,
                so needs to be prepended to accum. */
-            accum |= (twodigits)thisbyte << accumbits;
+            accum |= thisbyte << accumbits;
             accumbits += 8;
             if (accumbits >= PyLong_SHIFT) {
                 /* There's enough to fill a Python digit. */
@@ -1121,7 +1121,7 @@ PyLong_FromUnsignedLongLong(unsigned long long ival)
     if (ival < PyLong_BASE)
         return PyLong_FromLong((long)ival);
     /* Count the number of Python digits. */
-    t = (unsigned long long)ival;
+    t = ival;
     while (t) {
         ++ndigits;
         t >>= PyLong_SHIFT;