]> Cypherpunks repositories - gostls13.git/commit
math/big: simplify divBasic ujn assignment
authorJoel Sing <joel@sing.id.au>
Tue, 7 Feb 2023 12:15:07 +0000 (23:15 +1100)
committerGopher Robot <gobot@golang.org>
Mon, 16 Sep 2024 17:33:18 +0000 (17:33 +0000)
commit5367d696f7a610b0e3826914d2633888e66b9f0b
tree77da564e37ec3d93239500ccaed174f0f51d4366
parent4f95ad8ca2864268fe086e23ec5d0ee8b6d5e1c1
math/big: simplify divBasic ujn assignment

Rather than conditionally assigning ujn, initialise ujn above the
loop to invent the leading 0 for u, then unconditionally load ujn
at the bottom of the loop. This code operates on the basis that
n >= 2, hence j+n-1 is always greater than zero.

Change-Id: I1272ef30c787ed8707ae8421af2adcccc776d389
Reviewed-on: https://go-review.googlesource.com/c/go/+/467555
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Robert Griesemer <gri@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/math/big/natdiv.go