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<UInt8> where C : BidirectionalCollection, UInt8 == C.Element

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に準拠するならば、より速い遂行を期待できます。