This project has moved. For the latest updates, please go here.

About ThreadSafeStore<,>::AddValue.

Oct 15, 2013 at 8:29 PM

I have a question about ThreadSafeStore<,>::AddValue implementation (

First, why you check (_store == null) when it's always is not null (value assigned in a ctor)?
if (_store == null)
    _store = new Dictionary<TKey, TValue>();
And, why do you need a copying values from a store?
Dictionary<TKey, TValue> newStore = new Dictionary<TKey, TValue>(_store);
As I can see, its means that you copy all store every time when a new value needed. Is it correct? Why you can not add a new value to an existing store?