sestoft / C5

C5 generic collection library for C#/.NET
http://www.itu.dk/research/c5/
MIT License
1.03k stars 180 forks source link

Inconsistent/wrong implementations of Keys property by guarded dictionaries #54

Open eskesparsoe opened 7 years ago

eskesparsoe commented 7 years ago

GuardedDictionary implements the Keys property as 'return dict.Keys;' with a TODO: //TODO: guard with a read-only wrapper? Probably so!

GuardedSortedDictionary implements the Keys property as 'return null;'

The implementations should be fixed, in particular the one in GuardedSortedDictionary.

The implementations should probably wrap the keys of the wrapped dictionary in a GuardedCollection / GuardedSorted.

ondfisk commented 4 years ago

Fixed in 3.0.