Skip to content

Commit

Permalink
Merge pull request #1917 from ReactiveCocoa/skipRepeats-if-let
Browse files Browse the repository at this point in the history
Use multiple if-let unwrapping in skipRepeats
  • Loading branch information
jspahrsummers committed Apr 20, 2015
2 parents 13b39ab + a54ac2b commit 5d7e763
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ReactiveCocoa/Swift/Signal.swift
Expand Up @@ -530,11 +530,10 @@ public func skipRepeats<T, E>(isRepeat: (T, T) -> Bool)(signal: Signal<T, E>) ->
return signal
|> map { Optional($0) }
|> combinePrevious(nil)
|> filter {
switch $0 {
case let (.Some(a), .Some(b)) where isRepeat(a, b):
|> filter { (a, b) in
if let a = a, b = b where isRepeat(a, b) {
return false
default:
} else {
return true
}
}
Expand Down

0 comments on commit 5d7e763

Please sign in to comment.