]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify constant switch case sorting
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 17 Jun 2016 21:50:39 +0000 (14:50 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 23 Aug 2016 05:28:50 +0000 (05:28 +0000)
commita9266eef9384090d748acf723351a282b71982a8
tree9e05d76ac918b33983e3f0e18d73677863f7b28f
parente26499153e938b21850a7b6b33f27bb3d98e01cd
cmd/compile: simplify constant switch case sorting

This sort is now only reachable for constant clauses
for a non-interface switch expression value.

Refactor a bit so that the few tests that remain
are concise and easy to read.

Add a test that string length takes priority
over built-in string order.

Change-Id: Iedaa11ff77049d5ad1bf14f54cbb8c3411d589a7
Reviewed-on: https://go-review.googlesource.com/26767
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/swt.go
src/cmd/compile/internal/gc/swt_test.go