]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: simplify and optimize reorder3
authorMatthew Dempsky <mdempsky@google.com>
Sun, 27 Dec 2020 03:55:57 +0000 (19:55 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 28 Dec 2020 07:44:16 +0000 (07:44 +0000)
commit4c215c4fa934990d159c549bcdd85f9be92287cd
treebee432e73e93a7f9ede53ef2d3a3ee8d53750d8f
parente6c973198d9f8e68e4dce8637e2d1492032ce939
[dev.regabi] cmd/compile: simplify and optimize reorder3

reorder3 is the code responsible for ensuring that evaluation of an
N:N parallel assignment statement respects the order of evaluation
rules specified for Go.

This CL simplifies the code and improves it from an O(N^2) algorithm
to O(N).

Passes toolstash -cmp.

Change-Id: I04cd31613af6924f637b042be8ad039ec6a924c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/280437
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/walk/assign.go