FastLookupCollectionTCheckConsistency Property

Gets or sets whether consistency of the stored items should be checked when items are get or set in the collection.
Default value: , if the FastLookupCollectionT was initialized by the default constructor; otherwise, as it was specified.

Definition

Namespace: KGySoft.Collections.ObjectModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
C#
public bool CheckConsistency { get; set; }

Property Value

Boolean

Remarks

If CheckConsistency is , then the FastLookupCollectionT class is tolerant with direct modifications of the underlying collection but when inconsistency is detected, the cost of IndexOf and Contains methods can fall back to O(n) where n is the count of the elements in the collection.

  Caution

Do not store elements in a FastLookupCollectionT that may change their hash code while they are added to the collection. Finding such elements may fail even if CheckConsistency is .

See Also