Created
August 5, 2021 06:59
-
-
Save sergei-lapin/8143308ca6e89def9dd0a3a31da542af to your computer and use it in GitHub Desktop.
setPrefetchBound
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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