Remove a key from the dictionary. Whether the last copy of the key was removed.
(TKey key, out TValue row)
| 130 | /// <param name="key"></param> |
| 131 | /// <returns>Whether the last copy of the key was removed.</returns> |
| 132 | public bool Remove(TKey key, out TValue row) |
| 133 | { |
| 134 | if (RawDict.TryGetValue(key, out var result)) |
| 135 | { |
| 136 | row = result.Value; |
| 137 | if (result.Multiplicity == 1) |
| 138 | { |
| 139 | RawDict.Remove(key); |
| 140 | return true; |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | RawDict[key] = (result.Value, result.Multiplicity - 1); |
| 145 | return false; |
| 146 | } |
| 147 | } |
| 148 | row = default!; // uhh, this might be null. Good thing it's an internal method? |
| 149 | return false; |
| 150 | } |
| 151 | |
| 152 | public bool Equals(MultiDictionary<TKey, TValue> other) |
| 153 | { |
no outgoing calls