File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -94,24 +94,8 @@ final public class DataLoader<Key: Hashable, Value> {
9494 guard !keys. isEmpty else {
9595 return eventLoopGroup. next ( ) . makeSucceededFuture ( [ ] )
9696 }
97-
98- let promise : EventLoopPromise < [ Value ] > = eventLoopGroup. next ( ) . makePromise ( )
99-
100- var result = [ Value] ( )
101-
10297 let futures = try keys. map { try load ( key: $0, on: eventLoopGroup) }
103-
104- for future in futures {
105- _ = future. map { value in
106- result. append ( value)
107-
108- if result. count == keys. count {
109- promise. succeed ( result)
110- }
111- }
112- }
113-
114- return promise. futureResult
98+ return EventLoopFuture . whenAllSucceed ( futures, on: eventLoopGroup. next ( ) )
11599 }
116100
117101 /// Clears the value at `key` from the cache, if it exists. Returns itself for
You can’t perform that action at this time.
0 commit comments