Remove redundant else statement in linked list's contain function