]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: simplify error sorting
authorMatthew Dempsky <mdempsky@google.com>
Fri, 26 Feb 2016 02:17:31 +0000 (18:17 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 26 Feb 2016 03:10:13 +0000 (03:10 +0000)
commita5b7a8d6dd143b5b0b9631b0281559938d542c78
treebe73b5974efca824c6239e7b68366663ede49460
parente0fa809f4cd219c04efb5b4d78250ab937589dca
cmd/compile: simplify error sorting

Errors have unique seq values (their index within the errors slice),
so errcmp never needs to fallback to sorting by message text.
Moreover, comparing by original index is exactly the purpose of using
a stable sort algorithm (and sort.Stable was added in Go 1.2), so we
really only need to compare by lineno.

Change-Id: I7f534b72a05d899ae9788dc7ef0541dd92a8b578
Reviewed-on: https://go-review.googlesource.com/19929
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/subr.go