diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:33:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | e4e088d37070bab69b1457621706d65472874243 (patch) | |
tree | b031344561547208e567fa473e1640b302407a86 /plugins/SmileyAdd/src/smileys.h | |
parent | ba75602b16e4b9b484c2c05f70c117f612c81e1d (diff) |
SmileyAdd: C++'11 iterators
Diffstat (limited to 'plugins/SmileyAdd/src/smileys.h')
-rw-r--r-- | plugins/SmileyAdd/src/smileys.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index 4e174987d0..c44f1858fb 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -112,17 +112,15 @@ template<class T> struct SMOBJLIST : public OBJLIST<T> SMOBJLIST<T>& operator += (const SMOBJLIST<T>& lst)
{
- for (int i = 0; i < lst.getCount(); i++) {
- T *p = new T(lst[i]);
- insert(p);
- }
+ for (auto &it : lst)
+ insert(new T(*it));
return *this;
}
void splice(SMOBJLIST<T> &lst)
{
- for (int i = 0; i < lst.getCount(); i++)
- insert(&lst[i]);
+ for (auto &it : lst)
+ insert(it);
lst.LIST<T>::destroy();
}
};
|