Slight optimization of updateList function.