types/ptr: deprecate ptr.To, use Go 1.26 new
Updates #18682 Change-Id: I62f6aa0de2a15ef8c1435032c6aa74a181c25f8f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
8cfbaa717d
commit
2a64c03c95
+1
-3
@@ -12,8 +12,6 @@ package pool
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand/v2"
|
||||
|
||||
"tailscale.com/types/ptr"
|
||||
)
|
||||
|
||||
// consistencyCheck enables additional runtime checks to ensure that the pool
|
||||
@@ -77,7 +75,7 @@ func (p *Pool[V]) AppendTakeAll(dst []V) []V {
|
||||
func (p *Pool[V]) Add(item V) Handle[V] {
|
||||
// Store the index in a pointer, so that we can pass it to both the
|
||||
// handle and store it in the itemAndIndex.
|
||||
idx := ptr.To(len(p.s))
|
||||
idx := new(len(p.s))
|
||||
p.s = append(p.s, itemAndIndex[V]{
|
||||
item: item,
|
||||
index: idx,
|
||||
|
||||
Reference in New Issue
Block a user