How do collections implement Remove and Contains?
In particular, in the case of records. Do they look for exact references, or do they apply the record equality test as I'd expect them to?
Let's say I've got a simple record like:
And I've got a collection of
S
, such as a HashSet
. Will the HashSet test the values of X
and Y
and return true if it finds that the HashSet contains such an element? Or will it need the exact reference to S
?
That is, would the following be enough to find a reference containing an S
instance with X = 5
and Y = "42"
?
4 Replies
$tias?
Angius#1586
REPL Result: Success
Result: ValueTuple<bool, List<S>>
Compile: 684.494ms | Execution: 91.355ms | React with ❌ to remove this embed.
Alright lol.