mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
Optimize/eliminate bounds checking
TODO: do better at it by tracking min/max values of integers. The
following straightforward code doesn't have its bounds checks removed:
for _, n := range slice {
println(n)
}
This commit is contained in:
@@ -13,6 +13,7 @@ type _string struct {
|
||||
}
|
||||
|
||||
// Return true iff the strings match.
|
||||
//go:nobounds
|
||||
func stringEqual(x, y string) bool {
|
||||
if len(x) != len(y) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user