package kr.co.vividnext.sodalive.live.room.donation

import androidx.recyclerview.widget.DiffUtil

class LiveRoomDonationMessageDiffUtilCallback(
    private val oldData: List<LiveRoomDonationMessage>,
    private val newData: List<LiveRoomDonationMessage>
) : DiffUtil.Callback() {
    override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        val oldItem = oldData[oldItemPosition]
        val newItem = newData[newItemPosition]

        return oldItem.uuid == newItem.uuid
    }

    override fun getOldListSize(): Int = oldData.size

    override fun getNewListSize(): Int = newData.size

    override fun areContentsTheSame(
        oldItemPosition: Int,
        newItemPosition: Int
    ) = oldData[oldItemPosition] == newData[newItemPosition]
}
