aboutsummaryrefslogtreecommitdiff
path: root/src/math
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2017-10-29 21:04:01 +0000
committerRobert Griesemer <gri@golang.org>2017-11-15 18:48:48 +0000
commita265f2e90eb928ab773ecabf48aefb11b188296d (patch)
treeb47019b7fb6023583bdaf51643eb8a9627a59289 /src/math
parent89b7a08aea13d750f0bb48d88fea7dc867c9295c (diff)
downloadgo-a265f2e90eb928ab773ecabf48aefb11b188296d.tar.xz
go/printer: indent lone comments in composite lits
If a composite literal contains any comments on their own lines without any elements, the printer would unindent the comments. The comments in this edge case are written when the closing '}' is written. Indent and outdent first so that the indentation is interspersed before the comment is written. Also note that the go/printer golden tests don't show the exact same behaviour that gofmt does. Added a TODO to figure this out in a separate CL. While at it, ensure that the tree conforms to gofmt. The changes are unrelated to this indentation fix, however. Fixes #22355. Change-Id: I5ac25ac6de95a236f1e123479127cc4dd71e93fe Reviewed-on: https://go-review.googlesource.com/74232 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/math')
-rw-r--r--src/math/big/int.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/math/big/int.go b/src/math/big/int.go
index 135ebd083f..0eda9cd4e1 100644
--- a/src/math/big/int.go
+++ b/src/math/big/int.go
@@ -533,7 +533,6 @@ func (z *Int) GCD(x, y, a, b *Int) *Int {
// See Jebelean, "Improving the multiprecision Euclidean algorithm",
// Design and Implementation of Symbolic Computation Systems, pp 45-58.
func (z *Int) lehmerGCD(a, b *Int) *Int {
-
// ensure a >= b
if a.abs.cmp(b.abs) < 0 {
a, b = b, a
@@ -551,7 +550,6 @@ func (z *Int) lehmerGCD(a, b *Int) *Int {
// loop invariant A >= B
for len(B.abs) > 1 {
-
// initialize the digits
var a1, a2, u0, u1, u2, v0, v1, v2 Word