correct Pull method to break out of inner loop if a match is found
let's maybe not stop pulling elements after only the first one has been processed?
This commit is contained in:
parent
fcd7cb2013
commit
8b9720b70a
@ -172,12 +172,12 @@ func (d *Document) Pull(field string, a ...any) error {
|
||||
if fv.Kind() != reflect.Slice {
|
||||
return ErrNotASlice
|
||||
}
|
||||
outer:
|
||||
for _, b := range a {
|
||||
inner:
|
||||
for i := 0; i < fv.Len(); i++ {
|
||||
if reflect.DeepEqual(b, fv.Index(i).Interface()) {
|
||||
fv.Set(pull(fv, i, fv.Index(i).Type()))
|
||||
break outer
|
||||
break inner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user