File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ const (
2222 maxinternattempts = 3
2323)
2424
25- type strmap [T any ] sync.Map
25+ type comap [T any ] sync.Map
2626
2727// pointer to pointer v pointer to Gostr both come out
2828// with equal behaviour: go.dev/play/p/4qT1JACgdHG
29- func (s * strmap [T ]) get (k unique.Handle [string ]) (* * T , bool ) {
29+ func (s * comap [T ]) get (k unique.Handle [string ]) (* * T , bool ) {
3030 m := (* sync .Map )(s )
3131 if w , ok := m .Load (k ); ok {
3232 if v , ok := w .(weak.Pointer [T ]); ok {
@@ -40,7 +40,7 @@ func (s *strmap[T]) get(k unique.Handle[string]) (**T, bool) {
4040 return nil , false
4141}
4242
43- func (s * strmap [T ]) put (k unique.Handle [string ], v * * T ) (* * T , bool ) {
43+ func (s * comap [T ]) put (k unique.Handle [string ], v * * T ) (* * T , bool ) {
4444 m := (* sync .Map )(s )
4545 w := weak .Make (* v )
4646
@@ -65,8 +65,8 @@ reload:
6565}
6666
6767var (
68- interns = & strmap [Gostr ]{} // unique.Handle[string] => Gostr
69- interns2 = & strmap [Gostr2 ]{} // unique.Handle[string] => Gostr2
68+ interns = & comap [Gostr ]{} // unique.Handle[string] => Gostr
69+ interns2 = & comap [Gostr2 ]{} // unique.Handle[string] => Gostr2
7070
7171 mseed = maphash .MakeSeed ()
7272)
You can’t perform that action at this time.
0 commit comments