diff options
author | Max Horn | 2004-12-14 20:57:23 +0000 |
---|---|---|
committer | Max Horn | 2004-12-14 20:57:23 +0000 |
commit | ede24fabe2ea65e8d08800e246cea8eb7f12dfca (patch) | |
tree | 93906420dc7cb4ec1d87b4f61ab8fa3407cd7e03 /common | |
parent | 59b6a078266ee27d20315899e1b0cf650f01ecef (diff) | |
download | scummvm-rg350-ede24fabe2ea65e8d08800e246cea8eb7f12dfca.tar.gz scummvm-rg350-ede24fabe2ea65e8d08800e246cea8eb7f12dfca.tar.bz2 scummvm-rg350-ede24fabe2ea65e8d08800e246cea8eb7f12dfca.zip |
Patch #1083548 (common/list enhancement)
svn-id: r16046
Diffstat (limited to 'common')
-rw-r--r-- | common/list.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/common/list.h b/common/list.h index b37b8b1b64..1cf69f9500 100644 --- a/common/list.h +++ b/common/list.h @@ -164,9 +164,14 @@ public: return last; } -// void remove(const T &val) { -// ... -// } + void remove(const T &val) { + iterator i = begin(); + while (i != end()) + if (val == i.operator*()) + i = erase(i); + else + ++i; + } List<T>& operator =(const List<T>& list) { |