From ac14c18dbb90d15b8a5ad903b921690636a89581 Mon Sep 17 00:00:00 2001 From: IncSW Date: Mon, 12 Apr 2021 10:23:57 +0300 Subject: [PATCH] remove zero value checker for complex --- internal/encoder/encoder.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/internal/encoder/encoder.go b/internal/encoder/encoder.go index e0226d0..5363f52 100644 --- a/internal/encoder/encoder.go +++ b/internal/encoder/encoder.go @@ -568,9 +568,6 @@ func IsNilForMarshaler(v interface{}) bool { return rv.Uint() == 0 case reflect.Float32, reflect.Float64: return math.Float64bits(rv.Float()) == 0 - case reflect.Complex64, reflect.Complex128: - c := rv.Complex() - return math.Float64bits(real(c)) == 0 && math.Float64bits(imag(c)) == 0 case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Func: return rv.IsNil() case reflect.Slice: