| 1170 | fastpathTV.EncMapStringInt32V(rv2i(rv).(map[string]int32), e) |
| 1171 | } |
| 1172 | func (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 | } |
| 1198 | func (e *Encoder) fastpathEncMapStringFloat64R(f *codecFnInfo, rv reflect.Value) { |
| 1199 | fastpathTV.EncMapStringFloat64V(rv2i(rv).(map[string]float64), e) |
| 1200 | } |