ThreadSafeHashSetTTryAdd Method

Tries to add the specified item to the ThreadSafeHashSetT.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public bool TryAdd(
	T item
)

Parameters

item  T
The element to add to the set.

Return Value

Boolean
if item was added to the ThreadSafeHashSetT; if the element is already present judged by the Comparer.

Remarks

This method is functionally the same as the Add method. It is added to prevent mistakenly calling the EnumerableExtensions.TryAdd extension method, which would end up in a somewhat worse performance.

See Also