Open sandboxFocus

Method ApplyChanges

ApplyChanges(IncrementalHashSet<T>, in ApplyChangesContext)

Merges the current collection layer with another collection layer and returns the result.

Declaration
public IncrementalHashSet<T> ApplyChanges(IncrementalHashSet<T> other, in ApplyChangesContext context)
Parameters
Type Name Description
IncrementalHashSet<T> other

The collection layer to merge with the current layer.

ApplyChangesContext context

The context of the merge operation.

Returns
Type Description
IncrementalHashSet<T>

A new IncrementalHashSet<T> representing the merged result.

Remarks

If other contains a clear operation, it takes precedence and the result contains only the operations from other. Otherwise, operations from both layers are combined. For any item that appears in both layers, the operation from other takes precedence (i.e., if the current layer adds an item and other removes it, the final result will not contain the item).