He attributed it to the Prophet ﷺ, who said, "Hasten with the funeral. If she was righteous, then it is good that you are bringing her forward to it, and if she was otherwise, then it is an evil that you are removing from your shoulders."
أخبرنا قتيبة قال حدثنا سفيان عن الزهري عن سعيد
يبلغ به النبي ﷺ قال أسرعوا بالجنازة فإن تك صالحة فخير تقدمونها إليه وإن تك غير ذلك فشر تضعونه عن رقابكم
Bukhari transmitted it in the Book of Funerals, Chapter on Hastening with the Funeral, no. 1315, and Muslim in the Book of Funerals, Chapter on Hastening with the Funeral, no. 944, from the hadith of Sufyan bin Uyayna, through the same route, and it is also in Kubra, no. 2037.