mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
compiler: implement clear builtin for slices
This commit is contained in:
committed by
Ron Evans
parent
f791c821ff
commit
a2f886a67a
Vendored
+8
@@ -51,3 +51,11 @@ func maxFloat32(a, b float32) float32 {
|
||||
func maxString(a, b string) string {
|
||||
return max(a, b)
|
||||
}
|
||||
|
||||
func clearSlice(s []int) {
|
||||
clear(s)
|
||||
}
|
||||
|
||||
func clearZeroSizedSlice(s []struct{}) {
|
||||
clear(s)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user