MCPcopy
hub / github.com/ugorji/go / EncMapStringInt32V

Method EncMapStringInt32V

codec/fast-path.generated.go:1172–1197  ·  view source on GitHub ↗
(v map[string]int32, e *Encoder)

Source from the content-addressed store, hash-verified

1170 fastpathTV.EncMapStringInt32V(rv2i(rv).(map[string]int32), e)
1171}
1172func (fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) {
1173 e.mapStart(len(v))
1174 if e.h.Canonical {
1175 v2 := make([]string, len(v))
1176 var i uint
1177 for k := range v {
1178 v2[i] = k
1179 i++
1180 }
1181 sort.Sort(stringSlice(v2))
1182 for _, k2 := range v2 {
1183 e.mapElemKey()
1184 e.e.EncodeString(k2)
1185 e.mapElemValue()
1186 e.e.EncodeInt(int64(v[k2]))
1187 }
1188 } else {
1189 for k2, v2 := range v {
1190 e.mapElemKey()
1191 e.e.EncodeString(k2)
1192 e.mapElemValue()
1193 e.e.EncodeInt(int64(v2))
1194 }
1195 }
1196 e.mapEnd()
1197}
1198func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) {
1199 fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e)
1200}

Callers 3

CodecEncodeSelfMethod · 0.80
fastpathEncodeTypeSwitchFunction · 0.80

Calls 7

stringSliceTypeAlias · 0.85
EncodeStringMethod · 0.65
EncodeIntMethod · 0.65
mapStartMethod · 0.45
mapElemKeyMethod · 0.45
mapElemValueMethod · 0.45
mapEndMethod · 0.45

Tested by 1

CodecEncodeSelfMethod · 0.64