Rename structPointer_Map to structPointer_NewAt.
It was never map-specific, and will soon be used for other types.
diff --git a/proto/decode.go b/proto/decode.go
index 312e604..bf71dca 100644
--- a/proto/decode.go
+++ b/proto/decode.go
@@ -675,7 +675,7 @@
oi := o.index // index at the end of this map entry
o.index -= len(raw) // move buffer back to start of map entry
- mptr := structPointer_Map(base, p.field, p.mtype) // *map[K]V
+ mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V
if mptr.Elem().IsNil() {
mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem()))
}
diff --git a/proto/encode.go b/proto/encode.go
index b46f760..72c780b 100644
--- a/proto/encode.go
+++ b/proto/encode.go
@@ -1084,7 +1084,7 @@
repeated MapFieldEntry map_field = N;
*/
- v := structPointer_Map(base, p.field, p.mtype).Elem() // map[K]V
+ v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V
if v.Len() == 0 {
return nil
}
@@ -1123,7 +1123,7 @@
}
func size_new_map(p *Properties, base structPointer) int {
- v := structPointer_Map(base, p.field, p.mtype).Elem() // map[K]V
+ v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V
keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)
diff --git a/proto/pointer_reflect.go b/proto/pointer_reflect.go
index c68b125..749919d 100644
--- a/proto/pointer_reflect.go
+++ b/proto/pointer_reflect.go
@@ -144,8 +144,8 @@
return structPointer_ifield(p, f).(*map[int32]Extension)
}
-// Map returns the reflect.Value for the address of a map field in the struct.
-func structPointer_Map(p structPointer, f field, typ reflect.Type) reflect.Value {
+// NewAt returns the reflect.Value for a pointer to a field in the struct.
+func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
return structPointer_field(p, f).Addr()
}
diff --git a/proto/pointer_unsafe.go b/proto/pointer_unsafe.go
index 48bc0fa..e9be0fe 100644
--- a/proto/pointer_unsafe.go
+++ b/proto/pointer_unsafe.go
@@ -130,8 +130,8 @@
return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f)))
}
-// Map returns the reflect.Value for the address of a map field in the struct.
-func structPointer_Map(p structPointer, f field, typ reflect.Type) reflect.Value {
+// NewAt returns the reflect.Value for a pointer to a field in the struct.
+func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f)))
}