Skip to content

Instantly share code, notes, and snippets.

@sergei-lapin
Created August 5, 2021 06:59
Show Gist options
  • Select an option

  • Save sergei-lapin/8143308ca6e89def9dd0a3a31da542af to your computer and use it in GitHub Desktop.

Select an option

Save sergei-lapin/8143308ca6e89def9dd0a3a31da542af to your computer and use it in GitHub Desktop.
setPrefetchBound
internal fun setPrefetchBound(viewType: Int, count: Int) {
if (itemsQueued.getOrZero(viewType) >= count) return
itemsQueued[viewType] = count
val created = itemsCreated.getOrZero(viewType)
if (created >= count) return
repeat(count - created) { enqueueItemCreation(viewType) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment