package com.lukouguoji.module_base.ktx

fun List<*>.slipList(size: Int): List<List<*>> {
    val result = arrayListOf<List<*>>()
    var index = 0
    while (index < this.size) {
        val list = arrayListOf<Any>()
        for (i in index until index + size) {
            if (i < this.size) {
                list.add(this[i]!!)
            }
        }
        result.add(list)
        index += size
    }
    return result
}