You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm moving some code to use OrderedSet and noticed it is missing a filter operation.
Previous code:
// 1) we remove any registrations that it hostedletregistrations:Set<VersionedRegistration>=self._registrations.removeValue(forKey: key)??[]letremainingRegistrations:Set<VersionedRegistration>= registrations.filter{ registration in
registration.actorID.uniqueNode != node
}
this was ok, since we call the filter on:
extension Set {
@available(swift 4.0)
@inlinable public func filter(_ isIncluded: (Element) throws -> Bool) rethrows -> Set<Element>
}
but it seems that OrderedSet is missing this specialization, so we fallback to calling the Sequence's impl:
I'm moving some code to use
OrderedSet
and noticed it is missing afilter
operation.Previous code:
this was ok, since we call the filter on:
but it seems that OrderedSet is missing this specialization, so we fallback to calling the
Sequence
's impl:returning an array -- which is a bit meh, since we have to convert back into the
OrderedSet
.Feature Request
Please provide a
filter
similar to howSet
does that keeps the collection typeOrderedSet -> OrderedSet
The text was updated successfully, but these errors were encountered: