mirror of
https://github.com/json-iterator/go.git
synced 2025-01-17 18:44:50 +02:00
#95 struct and empty struct is considered as notempty
This commit is contained in:
parent
3cf9b7c253
commit
e260979001
@ -1092,12 +1092,7 @@ func (encoder *structEncoder) EncodeInterface(val interface{}, stream *Stream) {
|
||||
}
|
||||
|
||||
func (encoder *structEncoder) IsEmpty(ptr unsafe.Pointer) bool {
|
||||
for _, field := range encoder.fields {
|
||||
if !field.encoder.IsEmpty(ptr) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
type emptyStructEncoder struct {
|
||||
@ -1112,5 +1107,5 @@ func (encoder *emptyStructEncoder) EncodeInterface(val interface{}, stream *Stre
|
||||
}
|
||||
|
||||
func (encoder *emptyStructEncoder) IsEmpty(ptr unsafe.Pointer) bool {
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user