From 58db3e4df8918683a5ddabbfc760923e4c9d4c11 Mon Sep 17 00:00:00 2001 From: sergdort Date: Sat, 22 Jul 2017 16:54:29 +0100 Subject: [PATCH] Move mapping --- Network/Cache/Cache.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Network/Cache/Cache.swift b/Network/Cache/Cache.swift index 9504db8f..20a4bccd 100644 --- a/Network/Cache/Cache.swift +++ b/Network/Cache/Cache.swift @@ -121,12 +121,9 @@ final class Cache: AbstractCache where T == T.Encoder.DomainTyp observer(.completed) return Disposables.create() } - let domainObjects = objects.map { obj in - return obj.asDomain() - } - observer(MaybeEvent.success(domainObjects)) - return Disposables.create() - }.subscribeOn(chacheScheduler) + observer(MaybeEvent.success(objects.map { $0.asDomain() })) + return Disposables.create() + }.subscribeOn(chacheScheduler) } private func directoryURL() -> URL? {