diff options
author | Dan Kegel <[email protected]> | 2021-11-14 20:51:54 -0800 |
---|---|---|
committer | Ayke <[email protected]> | 2021-11-16 02:13:52 +0100 |
commit | b70b6076e3fd228f66feb12f8ba6be82c4e7926b (patch) | |
tree | 8b7e3b316929d7311cded7d8102ac8d42a8e63ff /loader | |
parent | 7b41d92198e9d28325ce1f0ec9be62e7f6eb1a6e (diff) | |
download | tinygo-b70b6076e3fd228f66feb12f8ba6be82c4e7926b.tar.gz tinygo-b70b6076e3fd228f66feb12f8ba6be82c4e7926b.zip |
net/ip, syscall/errno: Reduce code duplication by switching to internal/itoa.
internal/itoa wasn't around back in go 1.12 days when tinygo's syscall/errno.go was written.
It was only added as of go 1.17 ( https://github.com/golang/go/commit/061a6903a232cb868780b )
so we have to have an internal copy for now.
The internal copy should be deleted when tinygo drops support for go 1.16.
FWIW, the new version seems nicer.
It uses no allocations when converting 0,
and although the optimizer might make this moot, uses
a multiplication x 10 instead of a mod operation.
Diffstat (limited to 'loader')
-rw-r--r-- | loader/goroot.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/loader/goroot.go b/loader/goroot.go index 8f0acf1b8..88b467605 100644 --- a/loader/goroot.go +++ b/loader/goroot.go @@ -228,6 +228,7 @@ func pathsToOverride(needsSyscallPackage bool) map[string]bool { "internal/bytealg/": false, "internal/reflectlite/": false, "internal/task/": false, + "internal/itoa/": false, // TODO: Remove when we drop support for go 1.16 "machine/": false, "net/": true, "os/": true, |