diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-06-15 15:38:25 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-07-05 11:29:44 +0000 |
| commit | 9a3d2957802872770199d00684132907508a6915 (patch) | |
| tree | 47d66baa0b01b7deb770e8e2446dfae2d6ad1835 /pkg/kconfig | |
| parent | b78b123e8c4a7f91f3a63695f0887301cd3ce2aa (diff) | |
pkg/kconfig: make Clone() public
Diffstat (limited to 'pkg/kconfig')
| -rw-r--r-- | pkg/kconfig/config.go | 2 | ||||
| -rw-r--r-- | pkg/kconfig/minimize.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/kconfig/config.go b/pkg/kconfig/config.go index 4a917df28..4b01997a0 100644 --- a/pkg/kconfig/config.go +++ b/pkg/kconfig/config.go @@ -123,7 +123,7 @@ func ParseConfigData(data []byte, file string) (*ConfigFile, error) { return cf, nil } -func (cf *ConfigFile) clone() *ConfigFile { +func (cf *ConfigFile) Clone() *ConfigFile { cf1 := &ConfigFile{ Map: make(map[string]*Config), comments: cf.comments, diff --git a/pkg/kconfig/minimize.go b/pkg/kconfig/minimize.go index bbc66c4c1..cbeaba08b 100644 --- a/pkg/kconfig/minimize.go +++ b/pkg/kconfig/minimize.go @@ -27,7 +27,7 @@ func (kconf *KConfig) Minimize(base, full *ConfigFile, pred func(*ConfigFile) (b return base, nil } // Since base does not crash, full config is our best bet for now. - current := full.clone() + current := full.Clone() var suspects []string // Take half of the diff between base and full, apply to base and test. // If this candidate config crashes, we commit it as new full and repeat the process. @@ -47,7 +47,7 @@ top: for _, part := range [][]string{diff[:half], diff[half:]} { dt.Log("trying half: %v", part) closure := kconf.addDependencies(base, full, part) - candidate := base.clone() + candidate := base.Clone() // Always move all non-tristate configs from full to base as we don't minimize them. for _, cfg := range other { candidate.Set(cfg.Name, cfg.Value) |
