From 6f207a4601a9186017c7d847553ae8663d8dda83 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 12 Nov 2025 00:36:09 -0800 Subject: [PATCH] Add a const version of List::find --- core/templates/list.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/templates/list.h b/core/templates/list.h index 79a67c7e52e..7804921c479 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -415,6 +415,19 @@ public: /** * find an element in the list, */ + template + const Element *find(const T_v &p_val) const { + const Element *it = front(); + while (it) { + if (it->value == p_val) { + return it; + } + it = it->next(); + } + + return nullptr; + } + template Element *find(const T_v &p_val) { Element *it = front();