No need for canonical encoding for storage

This commit is contained in:
Tobie Morgan Hitchcock 2016-09-19 12:03:03 +01:00
parent aa4f788566
commit 93da1d16f3

View file

@ -35,7 +35,6 @@ func init() {
// GOB // GOB
gob.Register(time.Time{}) gob.Register(time.Time{})
jh.Canonical = true
gob.Register([]interface{}{}) gob.Register([]interface{}{})
gob.Register(map[string]interface{}{}) gob.Register(map[string]interface{}{})
gob.Register(sql.Null{}) gob.Register(sql.Null{})
@ -65,6 +64,7 @@ func init() {
// JSON // JSON
jh.Canonical = false
jh.CheckCircularRef = false jh.CheckCircularRef = false
jh.AsSymbols = codec.AsSymbolDefault jh.AsSymbols = codec.AsSymbolDefault
jh.SliceType = reflect.TypeOf([]interface{}(nil)) jh.SliceType = reflect.TypeOf([]interface{}(nil))
@ -72,7 +72,7 @@ func init() {
// CBOR // CBOR
ch.Canonical = true ch.Canonical = false
ch.CheckCircularRef = false ch.CheckCircularRef = false
ch.AsSymbols = codec.AsSymbolDefault ch.AsSymbols = codec.AsSymbolDefault
ch.SliceType = reflect.TypeOf([]interface{}(nil)) ch.SliceType = reflect.TypeOf([]interface{}(nil))
@ -80,7 +80,7 @@ func init() {
// BINC // BINC
bh.Canonical = true bh.Canonical = false
bh.CheckCircularRef = false bh.CheckCircularRef = false
bh.AsSymbols = codec.AsSymbolDefault bh.AsSymbols = codec.AsSymbolDefault
bh.SliceType = reflect.TypeOf([]interface{}(nil)) bh.SliceType = reflect.TypeOf([]interface{}(nil))
@ -103,7 +103,7 @@ func init() {
// PACK // PACK
mh.WriteExt = true mh.WriteExt = true
mh.Canonical = true mh.Canonical = false
mh.RawToString = true mh.RawToString = true
mh.CheckCircularRef = false mh.CheckCircularRef = false
mh.AsSymbols = codec.AsSymbolDefault mh.AsSymbols = codec.AsSymbolDefault