mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Updated CompilerOptimizations (markdown)
parent
661c2c5c57
commit
8124751ae6
@ -32,10 +32,10 @@ For a map `m` of type `map[string]T` and `[]byte b`, `m[string(b)]` doesn't allo
|
||||
Avoiding allocating `[]byte` of a `string` when ranging over the bytes:
|
||||
|
||||
```go
|
||||
s := "foo"
|
||||
for i, c := range []byte(s) {
|
||||
// ...
|
||||
}
|
||||
s := "foo"
|
||||
for i, c := range []byte(s) {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
* **gc:** 1.5+ (CL 3790)
|
||||
|
Loading…
x
Reference in New Issue
Block a user