From fc35a5a4921142f1425fc697c1e26b04b700dbf6 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 25 Feb 2020 16:11:59 +0100 Subject: Stop buffer_remove_entry_by_id() once we found the entry No need to continue to loop through the rest. --- src/ui/buffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ui/buffer.c') diff --git a/src/ui/buffer.c b/src/ui/buffer.c index 6a7f7818..c1d5e070 100644 --- a/src/ui/buffer.c +++ b/src/ui/buffer.c @@ -116,6 +116,7 @@ buffer_remove_entry_by_id(ProfBuff buffer, const char *const id) if (entry->id && (g_strcmp0(entry->id, id) == 0)) { _free_entry(entry); buffer->entries = g_slist_delete_link(buffer->entries, entries); + break; } entries = g_slist_next(entries); } -- cgit 1.4.1-2-gfad0