-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Basics] Switch IdentifiableSet
to use OrderedDictionary
#7630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Turns `IdentifiableSet` into an ordered collection which should cut on flakiness in tests and other spots that expect certain ordering of elements.
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
IMO definitely worth cherry-picking for 6.0. |
I was looking at struct Identified<Element> where Element: Identifiable {
var element: Element
}
extension Identified: Equatable {
static func ==(lhs: Self, rhs: Self) -> Bool { lhs.id == rhs.id }
}
extension Identified: Hashable {
func hash(into hasher: inout Hasher) -> Bool { hasher.combine(self.id) }
} |
How would one look up an element by its ID in |
Clearly I didn't think this through enough! |
For a bit more context, we were storing some of its elements in an |
- Explanation: Turns `IdentifiableSet` into an ordered collection which should cut on flakiness in tests and other spots that expect certain ordering of elements. - Scope: All uses of `IdentifiableSet` i.e. package graph. - Main Branch PR: #7630 - Risk: Low - Reviewed By: @MaxDesiatov - Testing: No tests since the change is somewhat NFC. (cherry picked from commit b0afde9)
Motivation:
Turns
IdentifiableSet
into an ordered collection which should cut on flakiness in tests and other spots that expect certain ordering of elements.Modifications:
Changes
storage
ofIdentifiableSet
fromDictionary
toOrderedDictionary
.Result:
Less flakiness throughout.