mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
all: format code according to Go 1.19 rules
Go 1.19 started reformatting code in a way that makes it more obvious how it will be rendered on pkg.go.dev. It gets it almost right, but not entirely. Therefore, I had to modify some of the comments so that they are formatted correctly.
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
// OptimizeStringToBytes transforms runtime.stringToBytes(...) calls into const
|
||||
// []byte slices whenever possible. This optimizes the following pattern:
|
||||
//
|
||||
// w.Write([]byte("foo"))
|
||||
// w.Write([]byte("foo"))
|
||||
//
|
||||
// where Write does not store to the slice.
|
||||
func OptimizeStringToBytes(mod llvm.Module) {
|
||||
@@ -91,12 +91,12 @@ func OptimizeStringEqual(mod llvm.Module) {
|
||||
|
||||
// OptimizeReflectImplements optimizes the following code:
|
||||
//
|
||||
// implements := someType.Implements(someInterfaceType)
|
||||
// implements := someType.Implements(someInterfaceType)
|
||||
//
|
||||
// where someType is an arbitrary reflect.Type and someInterfaceType is a
|
||||
// reflect.Type of interface kind, to the following code:
|
||||
//
|
||||
// _, implements := someType.(interfaceType)
|
||||
// _, implements := someType.(interfaceType)
|
||||
//
|
||||
// if the interface type is known at compile time (that is, someInterfaceType is
|
||||
// a LLVM constant aggregate). This optimization is especially important for the
|
||||
|
||||
Reference in New Issue
Block a user