private _deleteFromList(value: T): void {
const valueKey = this.identityFn(value);
while (temp !== this.tail) {
if (this.identityFn(temp.value) === valueKey) {
if (temp === this.head) {
this.head = this.head.next!;
this.head.previous = undefined;
temp.previous!.next = temp.next;
temp.next!.previous = temp.previous;
}
this._size--;
}
temp = temp.next!;
}
}
}