From 320b0dee7f3fabbed17cb120c19f21f3198c6e72 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 12 Apr 2026 05:04:10 +0000 Subject: [PATCH] Remove unused hasStructuralChildren method from tomlEncoder Agent-Logs-Url: https://github.com/mikefarah/yq/sessions/2c234b77-28e9-4995-ba6f-9d213ec551a0 Co-authored-by: mikefarah <1151925+mikefarah@users.noreply.github.com> --- pkg/yqlib/encoder_toml.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/pkg/yqlib/encoder_toml.go b/pkg/yqlib/encoder_toml.go index 6639a0f0..8c418cc2 100644 --- a/pkg/yqlib/encoder_toml.go +++ b/pkg/yqlib/encoder_toml.go @@ -533,29 +533,6 @@ func (te *tomlEncoder) encodeSeparateMapping(w io.Writer, path []string, m *Cand return nil } -func (te *tomlEncoder) hasStructuralChildren(m *CandidateNode) bool { - for i := 0; i < len(m.Content); i += 2 { - v := m.Content[i+1] - // Only consider it structural if mapping has EncodeHintSeparateBlock - if v.Kind == MappingNode && v.EncodeHint == EncodeHintSeparateBlock { - return true - } - if v.Kind == SequenceNode { - allMaps := true - for _, it := range v.Content { - if it.Kind != MappingNode { - allMaps = false - break - } - } - if allMaps { - return true - } - } - } - return false -} - // encodeMappingBodyWithPath encodes attributes and nested arrays of tables using full dotted path context func (te *tomlEncoder) encodeMappingBodyWithPath(w io.Writer, path []string, m *CandidateNode) error { // First, attributes (scalars and non-map arrays)