mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
move comment about empty-value of Arrays to the code path the array case takes
This commit is contained in:
+2
-1
@@ -214,7 +214,7 @@ func (g *Generator) notEmptyCheck(t reflect.Type, v string) string {
|
||||
}
|
||||
|
||||
switch t.Kind() {
|
||||
case reflect.Slice, reflect.Map: // note: Array types don't have a useful empty value
|
||||
case reflect.Slice, reflect.Map:
|
||||
return "len(" + v + ") != 0"
|
||||
case reflect.Interface, reflect.Ptr:
|
||||
return v + " != nil"
|
||||
@@ -229,6 +229,7 @@ func (g *Generator) notEmptyCheck(t reflect.Type, v string) string {
|
||||
return v + " != 0"
|
||||
|
||||
default:
|
||||
// note: Array types don't have a useful empty value
|
||||
return "true"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user