FeedWrangler removed and moved chunk to RSCore

This commit is contained in:
Stuart Breckenridge
2021-04-02 06:21:08 +08:00
parent 37ba4f0bb8
commit 1f71d5a744
3 changed files with 3 additions and 36 deletions

View File

@@ -1,22 +0,0 @@
//
// Array-Extensions.swift
// NetNewsWire
//
// Created by Stuart Breckenridge on 01/04/2021.
// Copyright © 2021 Ranchero Software. All rights reserved.
//
import Foundation
extension Array {
/// Splits an array in to chunks of size `size`.
/// - Note: Code from [Hacking with Swift](https://www.hackingwithswift.com/example-code/language/how-to-split-an-array-into-chunks).
/// - Parameter size: The size of the chunk.
/// - Returns: An array of `[Element]`s.
func chunked(into size: Int) -> [[Element]] {
return stride(from: 0, to: count, by: size).map {
Array(self[$0 ..< Swift.min($0 + size, count)])
}
}
}