Collection

public extension Collection

An extension of Collection, which calculates the diff between two collections.

  • Returns the diff between two collections.

    Complexity

    O(mn) where m and n are the lengths of the receiver and the given collection.

    Declaration

    Swift

    func diff(_ otherCollection: Self, by areEquivalent: (Element, Element) -> Bool) -> Diff<Index>

    Parameters

    otherCollection

    The collection with which to compare the receiver.

    Return Value

    The diff between the receiver and the given collection.

  • Returns the diff between two collections.

    Complexity

    O(mn) where m and n are the lengths of the receiver and the given collection.

    Declaration

    Swift

    func diff(_ otherCollection: Self) -> Diff<Index>

    Parameters

    otherCollection

    The collection with which to compare the receiver.

    Return Value

    The diff between the receiver and the given collection.