From d264b23089c1707ebeb3dd3a0532a5192e0746cf Mon Sep 17 00:00:00 2001 From: Vlad Date: Sat, 23 Jan 2021 21:53:08 +0300 Subject: [PATCH] refactor: update to RxSwift 6 --- .../Extensions/Sequence/Sequence+ConcurrentMap.swift | 2 +- Sources/Extensions/UIColor/UIColor+Hex.swift | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift b/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift index 71843141..773990f2 100644 --- a/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift +++ b/Sources/Extensions/Sequence/Sequence+ConcurrentMap.swift @@ -55,7 +55,7 @@ public extension Sequence { return Observable.from(indexedRanges) .flatMap { indexedRange -> Observable<(idx: Int, results: [R])> in Observable.just(indexedRange) - .observeOn(scheduler) + .observe(on: scheduler) .map { (idx: $0.idx, results: try array[$0.range].map(transform)) } } .toArray() diff --git a/Sources/Extensions/UIColor/UIColor+Hex.swift b/Sources/Extensions/UIColor/UIColor+Hex.swift index 42eea8b8..e313578c 100644 --- a/Sources/Extensions/UIColor/UIColor+Hex.swift +++ b/Sources/Extensions/UIColor/UIColor+Hex.swift @@ -138,9 +138,13 @@ public extension UIColor { getRed(&red, green: &green, blue: &blue, alpha: &alpha) - let intRepresentation = alpha == 1 - ? Int(red * 255) << 16 | Int(green * 255) << 8 | Int(blue * 255) << 0 - : Int(red * 255) << 24 | Int(green * 255) << 16 | Int(blue * 255) << 8 | Int(alpha * 255) << 0 + let intRepresentation: Int + + if alpha == 1 { + intRepresentation = Int(red * 255) << 16 | Int(green * 255) << 8 | Int(blue * 255) + } else { + intRepresentation = Int(red * 255) << 24 | Int(green * 255) << 16 | Int(blue * 255) << 8 | Int(alpha * 255) + } return String(intRepresentation, radix: 16) }