MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / Remove

Method Remove

sdks/csharp/src/MultiDictionary.cs:132–150  ·  view source on GitHub ↗

Remove a key from the dictionary. Whether the last copy of the key was removed.

(TKey key, out TValue row)

Source from the content-addressed store, hash-verified

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 {

Callers 15

RemovalsMethod · 0.45
ShuffleDeltaMethod · 0.45
ChunkedRemovalsMethod · 0.45
ApplyMessageMethod · 0.45
FinishTrackingRequestMethod · 0.45
UniqueIndexBaseMethod · 0.45
BTreeIndexBaseMethod · 0.45
ParseDeleteOnlyMethod · 0.45
ParseMethod · 0.45

Calls

no outgoing calls

Tested by 11

RemovalsMethod · 0.36
ShuffleDeltaMethod · 0.36
ChunkedRemovalsMethod · 0.36
SimpleConnectionTestMethod · 0.36