Skip to content

Commit d0f1958

Browse files
committed
Move declarations to top of function; rename high to lobits
1 parent 056495d commit d0f1958

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Objects/longobject.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4491,6 +4491,7 @@ long_rshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift)
44914491
{
44924492
PyLongObject *z = NULL;
44934493
Py_ssize_t newsize, hishift, i, j;
4494+
digit lobits, next;
44944495

44954496
if (Py_SIZE(a) < 0) {
44964497
/* Right shifting negative numbers is harder */
@@ -4514,13 +4515,13 @@ long_rshift1(PyLongObject *a, Py_ssize_t wordshift, digit remshift)
45144515
if (z == NULL)
45154516
return NULL;
45164517
j = wordshift;
4517-
digit next = a->ob_digit[j++];
4518+
lobits = a->ob_digit[j++] >> remshift;
45184519
for (i = 0; j < Py_SIZE(a); i++, j++) {
4519-
digit high = next >> remshift;
45204520
next = a->ob_digit[j];
4521-
z->ob_digit[i] = (high | next << hishift) & PyLong_MASK;
4521+
z->ob_digit[i] = (lobits | next << hishift) & PyLong_MASK;
4522+
lobits = next >> remshift;
45224523
}
4523-
z->ob_digit[i] = next >> remshift;
4524+
z->ob_digit[i] = lobits;
45244525
z = maybe_small_long(long_normalize(z));
45254526
}
45264527
return (PyObject *)z;

0 commit comments

Comments
 (0)