encode empty ps.Maps as nil

every little helps
This commit is contained in:
Matthias Radestock
2017-05-29 14:06:55 +01:00
parent e2bccd1d64
commit 94a11ff2e8

View File

@@ -125,7 +125,7 @@ func mapRead(decoder *codec.Decoder, decodeValue func(isNil bool) interface{}) p
// undocumented internal APIs apply.
func mapWrite(m ps.Map, encoder *codec.Encoder, encodeValue func(*codec.Encoder, interface{})) {
z, r := codec.GenHelperEncoder(encoder)
if m == nil {
if m == nil || m.IsNil() {
r.EncodeNil()
return
}