From 3a0126bd99877e43961b73a67d9905845df405a3 Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sun, 3 Feb 2019 10:06:12 -0500 Subject: [PATCH] Add note about queue_remove() --- endlessh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/endlessh.c b/endlessh.c index 772b5a2..81d1420 100644 --- a/endlessh.c +++ b/endlessh.c @@ -124,6 +124,9 @@ queue_init(struct queue *q) static struct client * queue_remove(struct queue *q, int fd) { + /* Yes, this is a linear search, but the element we're looking for + * is virtually always one of the first few elements. + */ struct client *c; struct client **prev = &q->head; for (c = q->head; c; prev = &c->next, c = c->next) {