Small refactor in doubly linked list search method.