| 1054 | fastpathTV.EncMapStringBytesV(rv2i(rv).(map[string][]byte), e) |
| 1055 | } |
| 1056 | func (fastpathT) EncMapStringBytesV(v map[string][]byte, e *Encoder) { |
| 1057 | e.mapStart(len(v)) |
| 1058 | if e.h.Canonical { |
| 1059 | v2 := make([]string, len(v)) |
| 1060 | var i uint |
| 1061 | for k := range v { |
| 1062 | v2[i] = k |
| 1063 | i++ |
| 1064 | } |
| 1065 | sort.Sort(stringSlice(v2)) |
| 1066 | for _, k2 := range v2 { |
| 1067 | e.mapElemKey() |
| 1068 | e.e.EncodeString(k2) |
| 1069 | e.mapElemValue() |
| 1070 | e.e.EncodeStringBytesRaw(v[k2]) |
| 1071 | } |
| 1072 | } else { |
| 1073 | for k2, v2 := range v { |
| 1074 | e.mapElemKey() |
| 1075 | e.e.EncodeString(k2) |
| 1076 | e.mapElemValue() |
| 1077 | e.e.EncodeStringBytesRaw(v2) |
| 1078 | } |
| 1079 | } |
| 1080 | e.mapEnd() |
| 1081 | } |
| 1082 | func (e *Encoder) fastpathEncMapStringUint8R(f *codecFnInfo, rv reflect.Value) { |
| 1083 | fastpathTV.EncMapStringUint8V(rv2i(rv).(map[string]uint8), e) |
| 1084 | } |