Avatar
このreduceSuccessがFutureとしてのモナディックなreduceで for (index, future) in futures.enumerated() { if future.eventLoop.inEventLoop, let result = future._value { // Fast-track already-fulfilled results without the overhead of calling `whenComplete`. This can yield a // ~20% performance improvement in the case of large arrays where all elements are already fulfilled. processResult(index, result) if case .failure = result { return // Once the promise is failed, future results do not need to be processed. } } else { future.hop(to: eventLoop) .whenComplete { result in processResult(index, result) } } }
9:52 AM
flatMapEachがreduceの呼び出しなので、やはりそう
9:52 AM
これで普通に困って、てか、 スタックオーバーフローしないとしても、Xcodeでデバッガで止めた時に
9:52 AM
このループの中だったときにスタックが50000段とかになってデバッガビリティが終わるんよな (edited)