mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Update comment decryption UI
This commit is contained in:
@@ -152,7 +152,7 @@ public final class DisposableSet : Disposable {
|
||||
|
||||
public func remove(_ disposable: Disposable) {
|
||||
pthread_mutex_lock(&self.lock)
|
||||
if let index = self.disposables.index(where: { $0 === disposable }) {
|
||||
if let index = self.disposables.firstIndex(where: { $0 === disposable }) {
|
||||
self.disposables.remove(at: index)
|
||||
}
|
||||
pthread_mutex_unlock(&self.lock)
|
||||
|
||||
@@ -30,19 +30,19 @@ public func deliverOn<T, E>(_ threadPool: ThreadPool) -> (Signal<T, E>) -> Signa
|
||||
let queue = threadPool.nextQueue()
|
||||
return signal.start(next: { next in
|
||||
queue.addTask(ThreadPoolTask { state in
|
||||
if !state.cancelled.with { $0 } {
|
||||
if !state.cancelled.with({ $0 }) {
|
||||
subscriber.putNext(next)
|
||||
}
|
||||
})
|
||||
}, error: { error in
|
||||
queue.addTask(ThreadPoolTask { state in
|
||||
if !state.cancelled.with { $0 } {
|
||||
if !state.cancelled.with({ $0 }) {
|
||||
subscriber.putError(error)
|
||||
}
|
||||
})
|
||||
}, completed: {
|
||||
queue.addTask(ThreadPoolTask { state in
|
||||
if !state.cancelled.with { $0 } {
|
||||
if !state.cancelled.with({ $0 }) {
|
||||
subscriber.putCompletion()
|
||||
}
|
||||
})
|
||||
@@ -97,7 +97,7 @@ public func runOn<T, E>(_ threadPool: ThreadPool) -> (Signal<T, E>) -> Signal<T,
|
||||
let disposable = MetaDisposable()
|
||||
|
||||
let task = ThreadPoolTask { state in
|
||||
if cancelled || state.cancelled.with { $0 } {
|
||||
if cancelled || state.cancelled.with({ $0 }) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public final class ThreadPoolTask {
|
||||
}
|
||||
|
||||
func execute() {
|
||||
if !state.cancelled.with { $0 } {
|
||||
if !state.cancelled.with({ $0 }) {
|
||||
self.action(self.state)
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public func ==(lhs: ThreadPoolQueue, rhs: ThreadPoolQueue) -> Bool {
|
||||
pthread_mutex_lock(&threadPool.mutex);
|
||||
|
||||
if queue != nil {
|
||||
if let index = threadPool.takenQueues.index(of: queue) {
|
||||
if let index = threadPool.takenQueues.firstIndex(of: queue) {
|
||||
threadPool.takenQueues.remove(at: index)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public func ==(lhs: ThreadPoolQueue, rhs: ThreadPoolQueue) -> Bool {
|
||||
task = queue.popFirstTask()
|
||||
threadPool.takenQueues.append(queue)
|
||||
|
||||
if let index = threadPool.queues.index(of: queue) {
|
||||
if let index = threadPool.queues.firstIndex(of: queue) {
|
||||
threadPool.queues.remove(at: index)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user