make(1): inline Lst_Enqueue
This commit is contained in:
parent
dfc53e1755
commit
19fb9dcba2
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lst.c,v 1.99 2020/12/04 20:08:07 rillig Exp $ */
|
||||
/* $NetBSD: lst.c,v 1.100 2020/12/04 20:11:48 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
#include "make.h"
|
||||
|
||||
MAKE_RCSID("$NetBSD: lst.c,v 1.99 2020/12/04 20:08:07 rillig Exp $");
|
||||
MAKE_RCSID("$NetBSD: lst.c,v 1.100 2020/12/04 20:11:48 rillig Exp $");
|
||||
|
||||
static ListNode *
|
||||
LstNodeNew(ListNode *prev, ListNode *next, void *datum)
|
||||
@ -242,17 +242,6 @@ Lst_AppendAll(List *dst, List *src)
|
||||
Lst_Append(dst, ln->datum);
|
||||
}
|
||||
|
||||
/*
|
||||
* for using the list as a queue
|
||||
*/
|
||||
|
||||
/* Add the datum to the tail of the given list. */
|
||||
void
|
||||
Lst_Enqueue(List *list, void *datum)
|
||||
{
|
||||
Lst_Append(list, datum);
|
||||
}
|
||||
|
||||
/* Remove and return the datum at the head of the given list. */
|
||||
void *
|
||||
Lst_Dequeue(List *list)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lst.h,v 1.91 2020/12/04 20:08:07 rillig Exp $ */
|
||||
/* $NetBSD: lst.h,v 1.92 2020/12/04 20:11:48 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
|
||||
@ -161,7 +161,11 @@ void LstNode_SetNull(ListNode *);
|
||||
/* Using the list as a queue */
|
||||
|
||||
/* Add a datum at the tail of the queue. */
|
||||
void Lst_Enqueue(List *, void *);
|
||||
MAKE_INLINE void
|
||||
Lst_Enqueue(List *list, void *datum) {
|
||||
Lst_Append(list, datum);
|
||||
}
|
||||
|
||||
/* Remove the head node of the queue and return its datum. */
|
||||
void *Lst_Dequeue(List *);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user