private void Remove(DictionaryModification <TKey, TValue> modification) { TValue removedValue; if (_dictionary._state.TryGetValue(modification.Key, out removedValue)) { _dictionary._state.Remove(modification.Key); _dictionary._subject.OnNext(DictionaryNotification.Removed(modification.Key, removedValue)); } // Design decision: We don't signal 'removed' for a value that didn't exist. }
private void Remove(DictionaryModification <TKey, TValue> modification) { TValue removedValue; if (_dictionary._state.TryGetValue(modification.Key, out removedValue)) { _dictionary._state.Remove(modification.Key); // TODO Should we signal 'removed' for a value that didn't exist..? _dictionary._subject.OnNext(DictionaryNotification.Removed(modification.Key, removedValue)); } }