From 775ace8f13e74e99366dbd2cc8194cecc73f0d61 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Fri, 5 Nov 2021 08:55:07 +0000 Subject: [PATCH] rm Paths() --- sdk/go/common/resource/properties_diff.go | 43 ----------------------- 1 file changed, 43 deletions(-) diff --git a/sdk/go/common/resource/properties_diff.go b/sdk/go/common/resource/properties_diff.go index ee384c792..5dfed1e3e 100644 --- a/sdk/go/common/resource/properties_diff.go +++ b/sdk/go/common/resource/properties_diff.go @@ -74,22 +74,6 @@ func (diff *ObjectDiff) Keys() []PropertyKey { return ks } -func (diff *ObjectDiff) Paths() []PropertyPath { - var paths []PropertyPath - for k := range diff.Adds { - paths = append(paths, PropertyPath{string(k)}) - } - for k := range diff.Adds { - paths = append(paths, PropertyPath{string(k)}) - } - for k, d := range diff.Updates { - for _, child := range d.Paths() { - paths = append(paths, append(PropertyPath{string(k)}, child...)) - } - } - return paths -} - // ValueDiff holds the results of diffing two property values. type ValueDiff struct { Old PropertyValue // the old value. @@ -99,17 +83,6 @@ type ValueDiff struct { Object *ObjectDiff // the object's detailed diffs (only for objects). } -func (diff ValueDiff) Paths() []PropertyPath { - switch { - case diff.Array != nil: - return diff.Array.Paths() - case diff.Object != nil: - return diff.Object.Paths() - default: - return nil - } -} - // ArrayDiff holds the results of diffing two arrays of property values. type ArrayDiff struct { Adds map[int]PropertyValue // elements added in the new. @@ -118,22 +91,6 @@ type ArrayDiff struct { Updates map[int]ValueDiff // elements that have changed in the new. } -func (diff *ArrayDiff) Paths() []PropertyPath { - var paths []PropertyPath - for k := range diff.Adds { - paths = append(paths, PropertyPath{k}) - } - for k := range diff.Adds { - paths = append(paths, PropertyPath{k}) - } - for k, d := range diff.Updates { - for _, child := range d.Paths() { - paths = append(paths, append(PropertyPath{k}, child...)) - } - } - return paths -} - // Len computes the length of this array, taking into account adds, deletes, sames, and updates. func (diff *ArrayDiff) Len() int { len := 0