Circular linked list Delete function

When we are finding the node to be deleted.then we first check for the rest of nodes.and when we check for the last node I think there is no need to do temp->next we.can directly apply if condition as after the while loop is executed temp is already pointing to the last node. But in the code which is shown in the video there is an extra line temp->next which make it not possible to check the last node.
Please tell which one is correct

hello @shivam.09 i have watched the video and they have done everything right in the video .
i hope i have cleared your doubt !
Happy Learning!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.