From 39878a3589bb659350aa3fbeda6a96a3e9c88bb2 Mon Sep 17 00:00:00 2001 From: Kare Morstol Date: Mon, 14 Dec 2015 00:40:19 +0100 Subject: [PATCH] Moved 'splitOnce' to the top. --- SwiftShell/General/Collection.swift | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/SwiftShell/General/Collection.swift b/SwiftShell/General/Collection.swift index 373eb8a..82d6d05 100644 --- a/SwiftShell/General/Collection.swift +++ b/SwiftShell/General/Collection.swift @@ -5,6 +5,15 @@ * */ +extension CollectionType where Generator.Element: Equatable { + + public func splitOnce (separator: Generator.Element) -> (head: SubSequence, tail: SubSequence?) { + guard let nextindex = indexOf(separator) else { return (self[startIndex..: GeneratorType, LazySequenceType { @@ -26,14 +35,6 @@ public struct LazySplitSequence (head: SubSequence, tail: SubSequence?) { - guard let nextindex = indexOf(separator) else { return (self[startIndex..