Files
RobustToolbox/Robust.Shared/Utility/UniqueIndexExtensions.cs
Tyler Young 4650dc2c49 ComponentManager Rework (#1143)
* rework ComponentManager

create indexing solution, UniqueIndex

split out ComponentEventArgs, add sealed variants

fix up documentation

fix terrible crap

make benchmark work

* woops, ordered enumerables are already a copy

* naming

* clean up comments

* nullable enable

* add some doc comments to unique index

* perf tweaks

add UniqueIndexHkm for high key mutability

extract internal interface mostly for documentation

add nullability support and constraints

* fix doc comment for UniqueIndexHkm

* make PVS threaded

* remove redundant member declarations in interface

* fix grid loss crap on client shutdown

* fix nullability warning when retrieving from always constructed threadlocal

* add comment explaining chan == null check

remove inParallel parameter
2020-06-24 11:59:56 +02:00

25 lines
811 B
C#

#nullable enable
using System.Diagnostics.CodeAnalysis;
namespace Robust.Shared.Utility
{
/// <summary>
/// Extension methods for <see cref="UniqueIndex{TKey,TValue}"/>.
/// </summary>
public static class UniqueIndexExtensions {
/// <summary>
/// Completely resets a <see cref="UniqueIndex{TKey,TValue}"/>.
/// </summary>
/// <param name="index">A given index.</param>
/// <typeparam name="TKey">The type of key.</typeparam>
/// <typeparam name="TValue">The type of value.</typeparam>
/// <seealso cref="UniqueIndex{TKey,TValue}"/>
[SuppressMessage("ReSharper", "RedundantAssignment")]
public static void Clear<TKey, TValue>(ref this UniqueIndex<TKey, TValue> index) where TKey: notnull => index = default;
}
}