Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onBindViewHolder remove extra allocation of empty payload #25

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

Karloid
Copy link
Contributor

@Karloid Karloid commented Jan 18, 2024

Using mutableListOf() will lead to the allocation of a temporary garbage object on each onBindViewHolder without payload, which adds to the overall overhead.

We can easily avoid this.

And there is no need to keep MutableList in

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int, payloads: MutableList<Any>)

because underlying RecyclerViewDelegate.onBindViewHolder has List in signature

@yatsinar yatsinar self-requested a review January 19, 2024 11:38
@yatsinar yatsinar merged commit 076190e into master Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants