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
Cards are entirely immutable as is, and with like 13,000+ of them potentially in use, it doesn't really make sense to copy them around as much as they're currently forced to be. Consider making Card a class.
The text was updated successfully, but these errors were encountered:
I dont think it should be a class. Swift best practice is to keep data as structs as long as you dont have a reason to use a reference type (like when you want to be able to modify a existing piece of data). And also, value types aren't always copied. The standard library tries to use copy-on-write for value types when able to, so chances are there are not actually any copies made if you just pass them around, specially for immutable data.
I dont think we should use classes unless we can see some weird performance issues related to using value types.
Cards are entirely immutable as is, and with like 13,000+ of them potentially in use, it doesn't really make sense to copy them around as much as they're currently forced to be. Consider making
Card
a class.The text was updated successfully, but these errors were encountered: