From c2e3572fe4a624d5a8fff733bf4db5d1c5fa6849 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 14 Apr 2008 10:07:15 +0000 Subject: [PATCH] Added contains() method to Common::List, same as in Common::Array svn-id: r31499 --- common/list.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/list.h b/common/list.h index 2fe07a5ccc1..7c514fd6f4b 100644 --- a/common/list.h +++ b/common/list.h @@ -26,6 +26,7 @@ #define COMMON_LIST_H #include "common/scummsys.h" +#include "common/algorithm.h" namespace Common { @@ -267,6 +268,10 @@ public: const_iterator end() const { return const_iterator(const_cast(&_anchor)); } + + bool contains(const t_T &key) const { + return find(begin(), end(), key) != end(); + } }; } // End of namespace Common