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.
This commit is contained in:
Adrien Destugues 2014-12-17 17:28:32 +01:00
parent a28398b3a2
commit 873914a020

View File

@ -20,6 +20,7 @@
#include <TypeConstants.h> #include <TypeConstants.h>
#include <AutoDeleter.h> #include <AutoDeleter.h>
#include <util/SinglyLinkedList.h>
#include <util/DoublyLinkedList.h> #include <util/DoublyLinkedList.h>
#include "cdda.h" #include "cdda.h"
@ -41,7 +42,7 @@ struct attr_cookie;
struct dir_cookie; struct dir_cookie;
typedef DoublyLinkedList<Attribute> AttributeList; typedef DoublyLinkedList<Attribute> AttributeList;
typedef DoublyLinkedList<attr_cookie> AttrCookieList; typedef SinglyLinkedList<attr_cookie> AttrCookieList;
struct riff_header { struct riff_header {
uint32 magic; uint32 magic;
@ -255,7 +256,7 @@ enum {
ITERATION_STATE_BEGIN = ITERATION_STATE_DOT, ITERATION_STATE_BEGIN = ITERATION_STATE_DOT,
}; };
struct attr_cookie : DoublyLinkedListLinkImpl<attr_cookie> { struct attr_cookie : SinglyLinkedListLinkImpl<attr_cookie> {
Attribute* current; Attribute* current;
}; };
@ -1372,7 +1373,8 @@ Inode::AddAttrCookie(attr_cookie* cookie)
void void
Inode::RemoveAttrCookie(attr_cookie* cookie) Inode::RemoveAttrCookie(attr_cookie* cookie)
{ {
fAttrCookies.Remove(cookie); if (!fAttrCookies.Remove(cookie))
panic("Tried to remove %p which is not in cookie list.", cookie);
} }