]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: clean up funcID assignment
authorRuss Cox <rsc@golang.org>
Thu, 28 Jan 2021 14:32:55 +0000 (09:32 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 00:01:59 +0000 (00:01 +0000)
commit229695a2833ead7bbee53071f52f34e2ce1c2802
tree6649e9f2403e268600f714502bd9c0b61cbc3f40
parentc80da0a33a240469892a0b0713f09607efb28752
runtime: clean up funcID assignment

Large enum sets should be sorted by name when the
values don't matter, as they don't here. Do that.

Also replace the large switch with a map lookup.

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.

Change-Id: Ibe727b5d8866bf4c40c96020e1f4632bde7efd59
Reviewed-on: https://go-review.googlesource.com/c/go/+/288798
Trust: Russ Cox <rsc@golang.org>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/internal/objabi/funcid.go
src/runtime/symtab.go