code review

This commit is contained in:
Donny Xia
2020-07-13 16:40:34 -07:00
parent c6b6dec91f
commit 23bd4390d3
2 changed files with 25 additions and 28 deletions

View File

@@ -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 {