News for hackers. Stuff that matters.
Re:New Features in C# 7.0 by ygra on Friday March 10, 2017 @10:21AM (#13839219)
If I'm reading the source correctly you could still get the bucket index and before you return true and the value, have that value removed from the dictionary. There is no synchronization going on, so concurrent modifications are just as much a problem with TryGetValue as with other approaches. TryGetValue is not atomic either.
Re:New Features in C# 7.0 by louthy on Friday March 10, 2017 @01:06PM (#13840642)
Ok, fair enough. My mistake. Glad I don't use the BCL collection types any more and stick to immutable maps, lists, and sets :)