Instance Method

applying(_:)

Applies the given difference to this collection.

Declaration

func applying(_ difference: CollectionDifference<Element>) -> ArraySlice<Element>?

Parameters

difference

The difference to be applied.

Return Value

An instance representing the state of the receiver with the difference applied, or nil if the difference is incompatible with the receiver’s state.

Discussion

Complexity: O(n + c), where n is self.count and c is the number of changes contained by the parameter.