© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Ilya
Why wouldn't you just use subList? db.chatDao().insertChats(list.subList(0, 45))
if (list.size > 45) list.subList(45, list.size).chunked(150).forEach { db.chatDao().insertChats(it) }
Tushar Pingale
Make dreams happen
This is because we are unaware of the list size. The list is populated based on paginated response.