Generic Instance Method 総称体インスタンスメソッド

difference(from:)

Returns the difference needed to produce this collection’s ordered elements from the given collection. このコレクションのもつ順番付けられた要素をこの与えられたコレクションから生成するのに必要とされる差異を返します。

Declaration 宣言

func difference<C>(from other: C) -> CollectionDifference<Base.Element> where C : BidirectionalCollection, Base.Element == C.Element
Available when Base.Element conforms to Equatable. Base.ElementEquatableに準拠する時に利用可能です。

Parameters パラメータ

other

The base state. 基底状態。

Return Value 戻り値

The difference needed to produce this collection’s ordered elements from the given collection. このコレクションのもつ順番付けられた要素をこの与えられたコレクションから生成するのに必要とされる差異。

Discussion 解説

This function does not infer element moves. If you need to infer moves, call the inferringMoves() method on the resulting difference. この関数は、要素が移動することを推測しません。あなたが移動の推論を必要とするならば、inferringMoves()メソッドを結果の差異の上で呼び出してください。

Complexity: Worst case performance is O(n * m), where n is the count of this collection and m is other.count. You can expect faster execution when the collections share many common elements, or if Element conforms to Hashable. 計算量:最悪の場合の性能は、O(n * m)です、ここでnはこのコレクションの総数です、そしてmother.countです。あなたはより速い遂行を予想できます、コレクションそれらが多くの普通の要素を共有する場合は、またはもしElementHashableに準拠するならば。