File tree Expand file tree Collapse file tree 2 files changed +1
-4
lines changed Expand file tree Collapse file tree 2 files changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,6 @@ func (s *Set) Intersection(s2 *Set) *Set {
80
80
// Difference returns a Set containing elements which:
81
81
// * appear in s
82
82
// * do not appear in s2
83
- // * and are not children of elements that appear in s2.
84
83
//
85
84
// In other words, for leaf fields, this acts like a regular set difference
86
85
// operation. When non leaf fields are compared with leaf fields ("parents"
@@ -284,9 +283,6 @@ func (s *SetNodeMap) Difference(s2 *Set) *SetNodeMap {
284
283
out := & SetNodeMap {}
285
284
for k , sn := range s .members {
286
285
pe := sn .pathElement
287
- if s2 .Members .Has (pe ) {
288
- continue
289
- }
290
286
if sn2 , ok := s2 .Children .members [k ]; ok {
291
287
diff := * sn .set .Difference (sn2 .set )
292
288
// We aren't permitted to add nodes with no elements.
Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ func TestSetIntersectionDifference(t *testing.T) {
292
292
MakePathOrDie ("foo" , 0 ),
293
293
MakePathOrDie ("b0" , nameFirst ),
294
294
MakePathOrDie ("bar" , "c0" ),
295
+ MakePathOrDie ("cp" , nameFirst , "child" ),
295
296
)
296
297
297
298
got := s1 .Difference (s2 )
You can’t perform that action at this time.
0 commit comments