目录

LazyArray

Array and list operations made lazy.

swift travis codecov pod Carthage compatible codebeat badge

LazyArray is a standalone generic immutable list with O(1) only’s methods.

  • Map: In Swift.Array, map function has a O(n) complexity. In LazyArray, the map will be applied on demande.
  • Cache: Will cache result before returning. Great when you use the map operator

From Swift.Collection

  • Prefix, Suffix
  • first, last
  • dropFirst, dropLast
  • reversed

Note about memory impact

Original array will be wrapped for each operation. Functions that are supposed to modify the LazyArray’s size will not drops the elements from memory.

Installation

Carthage

LazyArray is carthage compatible. Add the following entry in your Cartfile:

github "lucas34/LazyArray"

Then run carthage update.

CocoaPods

You can use CocoaPods to install LazyArray by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!
pod 'LazyArray'

In your application, simply import the library

import LazyArray

Contributors

We would love you for the contribution to LazyArray, check the LICENSE file for more info.

Licence

Distributed under the MIT license. See LICENSE for more information.

关于
75.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号