diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 477a6ea70d0bb1b1dfe9cbd9a15b6dad0284ddeb (patch) | |
tree | 247eed13a5231c3983e343f0b7fc2a95012353c2 /plugins/FloatingContacts/src/thumbs.cpp | |
parent | 9d0174ebe2bd005418855b18f737c36d5c20ab4a (diff) |
all another C++'11 iterators
Diffstat (limited to 'plugins/FloatingContacts/src/thumbs.cpp')
-rw-r--r-- | plugins/FloatingContacts/src/thumbs.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 27f953a689..46a593c656 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -107,15 +107,14 @@ void ThumbInfo::PositionThumbWorker(int nX, int nY, POINT *newPos) if (fcOpt.bMoveTogether)
UndockThumbs(this, thumbList.FindThumb(dockOpt.hwndLeft));
- for (int i = 0; i < thumbList.getCount(); ++i) {
- ThumbInfo *pCurThumb = &thumbList[i];
- if (pCurThumb == this)
+ for (auto &it : thumbList) {
+ if (it == this)
continue;
GetThumbRect(&rcThumb);
OffsetRect(&rcThumb, nX - rcThumb.left, nY - rcThumb.top);
- pCurThumb->GetThumbRect(&rc);
+ it->GetThumbRect(&rc);
// These are rects we will dock into
@@ -190,10 +189,10 @@ void ThumbInfo::PositionThumbWorker(int nX, int nY, POINT *newPos) if (fcOpt.bMoveTogether) {
if (bDockedRight)
- DockThumbs(this, pCurThumb);
+ DockThumbs(this, it);
if (bDockedLeft)
- DockThumbs(pCurThumb, this);
+ DockThumbs(it, this);
}
// Lower-left
@@ -776,9 +775,9 @@ ThumbInfo* ThumbList::FindThumb(HWND hwnd) {
if (!hwnd) return nullptr;
- for (int i = 0; i < getCount(); ++i)
- if (items[i]->hwnd == hwnd)
- return items[i];
+ for (auto &it : *this)
+ if (it->hwnd == hwnd)
+ return it;
return nullptr;
}
@@ -787,9 +786,9 @@ ThumbInfo *ThumbList::FindThumbByContact(MCONTACT hContact) {
if (!hContact) return nullptr;
- for (int i = 0; i < getCount(); ++i)
- if (items[i]->hContact == hContact)
- return items[i];
+ for (auto &it : *this)
+ if (it->hContact == hContact)
+ return it;
return nullptr;
}
|