Optimized some of the DoublyLinkedList class.

Signed-off-by: dadamitskiy <dadamitskiy@fullsail.edu>