Added contains() method to Common::List, same as in Common::Array

svn-id: r31499
This commit is contained in:
Filippos Karapetis 2008-04-14 10:07:15 +00:00
parent 8cc1539315
commit c2e3572fe4

View File

@ -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<NodeBase*>(&_anchor));
}
bool contains(const t_T &key) const {
return find(begin(), end(), key) != end();
}
};
} // End of namespace Common