From 873914a02043973156dccbccc36dc9dae7fa164d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 17 Dec 2014 17:28:32 +0100 Subject: [PATCH] cdda: use singly linked list for attribute cookies The list is only iterated forward so there is no need for a doubly linked one. No functional changes. --- src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp index 9d825b79d81..d31d9672f5b 100644 --- a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include "cdda.h" @@ -41,7 +42,7 @@ struct attr_cookie; struct dir_cookie; typedef DoublyLinkedList AttributeList; -typedef DoublyLinkedList AttrCookieList; +typedef SinglyLinkedList AttrCookieList; struct riff_header { uint32 magic; @@ -255,7 +256,7 @@ enum { ITERATION_STATE_BEGIN = ITERATION_STATE_DOT, }; -struct attr_cookie : DoublyLinkedListLinkImpl { +struct attr_cookie : SinglyLinkedListLinkImpl { Attribute* current; }; @@ -1372,7 +1373,8 @@ Inode::AddAttrCookie(attr_cookie* cookie) void Inode::RemoveAttrCookie(attr_cookie* cookie) { - fAttrCookies.Remove(cookie); + if (!fAttrCookies.Remove(cookie)) + panic("Tried to remove %p which is not in cookie list.", cookie); }