Replace single-linked with double-linked lists. It results in more
compact and more efficient code. * grub-core/kern/list.c (grub_list_push): Moved from here ... * include/grub/list.h (grub_list_push): ... to here. Set prev. (grub_list_remove): Moved from here ... * include/grub/list.h (grub_list_remove): ... here. Use and set prev. (grub_prio_list_insert): Set prev. * include/grub/list.h (grub_list): Add prev. All users updated.
This commit is contained in:
parent
48b391e9ab
commit
87edb8940a
27 changed files with 111 additions and 75 deletions
|
@ -25,6 +25,7 @@
|
|||
struct grub_net_udp_socket
|
||||
{
|
||||
struct grub_net_udp_socket *next;
|
||||
struct grub_net_udp_socket **prev;
|
||||
|
||||
enum { GRUB_NET_SOCKET_START,
|
||||
GRUB_NET_SOCKET_ESTABLISHED,
|
||||
|
@ -53,8 +54,7 @@ udp_socket_register (grub_net_udp_socket_t sock)
|
|||
void
|
||||
grub_net_udp_close (grub_net_udp_socket_t sock)
|
||||
{
|
||||
grub_list_remove (GRUB_AS_LIST_P (&udp_sockets),
|
||||
GRUB_AS_LIST (sock));
|
||||
grub_list_remove (GRUB_AS_LIST (sock));
|
||||
grub_free (sock);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue