Skip to content

Commit

Permalink
cdda: use singly linked list for attribute cookies
Browse files Browse the repository at this point in the history
The list is only iterated forward so there is no need for a doubly
linked one.
No functional changes.
  • Loading branch information
pulkomandy committed Dec 17, 2014
1 parent a28398b commit 873914a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
Expand Up @@ -20,6 +20,7 @@
#include <TypeConstants.h>

#include <AutoDeleter.h>
#include <util/SinglyLinkedList.h>
#include <util/DoublyLinkedList.h>

#include "cdda.h"
Expand All @@ -41,7 +42,7 @@ struct attr_cookie;
struct dir_cookie;

typedef DoublyLinkedList<Attribute> AttributeList;
typedef DoublyLinkedList<attr_cookie> AttrCookieList;
typedef SinglyLinkedList<attr_cookie> AttrCookieList;

struct riff_header {
uint32 magic;
Expand Down Expand Up @@ -255,7 +256,7 @@ enum {
ITERATION_STATE_BEGIN = ITERATION_STATE_DOT,
};

struct attr_cookie : DoublyLinkedListLinkImpl<attr_cookie> {
struct attr_cookie : SinglyLinkedListLinkImpl<attr_cookie> {
Attribute* current;
};

Expand Down Expand Up @@ -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);
}


Expand Down

0 comments on commit 873914a

Please sign in to comment.