1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Generalize the helper method to arbitrary mutable collection types.

This commit is contained in:
Rob Rix 2015-11-04 16:57:03 -05:00
parent 50518da5e1
commit 703db77789

View File

@ -75,7 +75,7 @@ public struct Location<A>: SequenceType {
return Location(flip(weave), reconstruct >>> up, t1, t2, t3)
}
public static func variadic(ts: [A], _ weave: Weave, _ reconstruct: [A] -> A)(_ up: A -> Location?) -> Location? {
public static func variadic<C: MutableCollectionType where C.Generator.Element == A, C.Index: BidirectionalIndexType>(ts: C, _ weave: Weave, _ reconstruct: C -> A)(_ up: A -> Location?) -> Location? {
return Location(flip(weave), reconstruct >>> up, ts)
}