# `GSDistinctParentsOfObjects`

*Function*

Returns a distinct set of parent objects of the given objects.

## Declaration

```swift
func GSDistinctParentsOfObjects(_ objects: (any NSFastEnumeration)?) -> NSHashTable<AnyObject>?
```

```objc
NSHashTable *GSDistinctParentsOfObjects(id<NSFastEnumeration>objects);
```

```python
GSDistinctParentsOfObjects(objects: object) -> NSHashTable
```

## Discussion

Each object of `objects` must respond to `-parent`. If a parent of `nil` returned, the parent is ignored.

Note that you can iterate over the returned `NSHashTable` directly instead of converting it to an array first as it holds a strong reference to the parent objects.

Uniqueness of the parent objects is based on their pointer identity; `-isEqual:` and `-hash` are not used.

Returns `nil` if `objects` is `nil` to fit along Objective-C message sending semantics.

