mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
code review
This commit is contained in:
@@ -28,10 +28,7 @@ func NullNode() *RNode {
|
||||
|
||||
// IsMissingOrNull returns true if the RNode is nil or contains and explicitly null value.
|
||||
func IsMissingOrNull(node *RNode) bool {
|
||||
if node == nil || node.YNode() == nil || node.YNode().Tag == NullNodeTag {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return node == nil || node.YNode() == nil || node.YNode().Tag == NullNodeTag
|
||||
}
|
||||
|
||||
// IsEmpty returns true if the RNode is MissingOrNull, or is either a MappingNode with
|
||||
@@ -44,11 +41,7 @@ func IsEmpty(node *RNode) bool {
|
||||
// Empty sequence is a special case and temporarily not considered as empty here.
|
||||
// Some users may want to keep empty sequence for compatibility reason.
|
||||
// For example, use JSON 6902 patch.
|
||||
if node.YNode().Kind == yaml.MappingNode && len(node.YNode().Content) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
return node.YNode().Kind == yaml.MappingNode && len(node.YNode().Content) == 0
|
||||
}
|
||||
|
||||
func IsNull(node *RNode) bool {
|
||||
|
||||
Reference in New Issue
Block a user