Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Set()

IAsyncLocalValueMap System.Threading.AsyncLocalValueMap.ManyElementAsyncLocalValueMap.Set ( IAsyncLocal key,
object value,
bool treatNullValueAsNonexistent )
inline

Implements System.Threading.IAsyncLocalValueMap.

Definition at line 305 of file AsyncLocalValueMap.cs.

306 {
307 int count = base.Count;
308 bool flag = ContainsKey(key);
309 if (value != null || !treatNullValueAsNonexistent)
310 {
312 using (Enumerator enumerator = GetEnumerator())
313 {
314 while (enumerator.MoveNext())
315 {
317 manyElementAsyncLocalValueMap[current.Key] = current.Value;
318 }
319 }
322 }
323 if (flag)
324 {
325 if (count == 17)
326 {
327 MultiElementAsyncLocalValueMap multiElementAsyncLocalValueMap = new MultiElementAsyncLocalValueMap(16);
328 int num = 0;
329 using Enumerator enumerator2 = GetEnumerator();
330 while (enumerator2.MoveNext())
331 {
333 if (key != current2.Key)
334 {
335 multiElementAsyncLocalValueMap.UnsafeStore(num++, current2.Key, current2.Value);
336 }
337 }
339 }
341 using Enumerator enumerator3 = GetEnumerator();
342 while (enumerator3.MoveNext())
343 {
345 if (key != current3.Key)
346 {
348 }
349 }
351 }
352 return this;
353 }

References System.Collections.Generic.Dictionary< IAsyncLocal, object >.Dictionary(), System.Threading.AsyncLocalValueMap.ManyElementAsyncLocalValueMap.ManyElementAsyncLocalValueMap(), System.Collections.Generic.Dictionary< IAsyncLocal, object >.ContainsKey(), System.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Collections.Generic.Dictionary< IAsyncLocal, object >.GetEnumerator(), System.key, and System.value.