KGy SOFT

CircularSortedListTKey, TValueIndexOfValue Method

KGy SOFT Core Libraries Help

Namespace:  KGySoft.Collections
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0
Syntax

public int IndexOfValue(
	TValue value
)

Parameters

value
Type: TValue
The value to locate in the CircularSortedListTKey, TValue. The value can be  for reference and NullableT types.

Return Value

Type: Int32
The zero-based index of the first occurrence of value within the entire CircularSortedListTKey, TValue, if found; otherwise, -1.
Remarks

This method determines equality using the EnumComparer<TEnum>.Comparer when TValue is an enum type, or the default equality comparer EqualityComparer<T>.Default for other TValue types. EqualityComparer<T>.Default checks whether the value type TValue implements IEquatableT and uses that implementation, if available. If not, EqualityComparer<T>.Default uses Object.Equals.

This method performs a linear search; therefore, the average execution time is proportional to Count. That is, this method is an O(n) operation, where n is Count.

See Also

Reference