diff options
author | Tobias Markmann <tm@ayena.de> | 2016-11-23 07:09:39 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-11-23 11:30:02 (GMT) |
commit | e405ff3561be3d3c0bd79d7d5173923a8828cf02 (patch) | |
tree | 9118ef838ebfaec1df90ec24761944b5d833774c /Swiften/MUC | |
parent | 8a71b91be885652f37c5aab5e1ecf25af4599fbc (diff) | |
download | swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.zip swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.tar.bz2 |
Migrate remaining Swiften/Base/foreach.h use to range-based for loop
Test-Information:
Build on macOS 10.12.1 and all tests pass.
Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
Diffstat (limited to 'Swiften/MUC')
-rw-r--r-- | Swiften/MUC/MUCBookmarkManager.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Swiften/MUC/MUCBookmarkManager.cpp b/Swiften/MUC/MUCBookmarkManager.cpp index a06a0a2..9f8ae77 100644 --- a/Swiften/MUC/MUCBookmarkManager.cpp +++ b/Swiften/MUC/MUCBookmarkManager.cpp @@ -10,7 +10,6 @@ #include <boost/bind.hpp> -#include <Swiften/Base/foreach.h> #include <Swiften/Queries/IQRouter.h> #include <Swiften/Queries/Requests/GetPrivateStorageRequest.h> #include <Swiften/Queries/Requests/SetPrivateStorageRequest.h> @@ -36,12 +35,12 @@ void MUCBookmarkManager::handleBookmarksReceived(std::shared_ptr<Storage> payloa storage = payload; std::vector<MUCBookmark> receivedBookmarks; - foreach (Storage::Room room, payload->getRooms()) { + for (const auto& room : payload->getRooms()) { receivedBookmarks.push_back(MUCBookmark(room)); } std::vector<MUCBookmark> newBookmarks; - foreach (const MUCBookmark& oldBookmark, bookmarks_) { + for (const auto& oldBookmark : bookmarks_) { if (containsEquivalent(receivedBookmarks, oldBookmark)) { newBookmarks.push_back(oldBookmark); } else { @@ -49,7 +48,7 @@ void MUCBookmarkManager::handleBookmarksReceived(std::shared_ptr<Storage> payloa } } - foreach (const MUCBookmark& newBookmark, receivedBookmarks) { + for (const auto& newBookmark : receivedBookmarks) { if (!containsEquivalent(bookmarks_, newBookmark)) { newBookmarks.push_back(newBookmark); onBookmarkAdded(newBookmark); @@ -102,7 +101,7 @@ void MUCBookmarkManager::flush() { } // Update the storage element storage->clearRooms(); - foreach(const MUCBookmark& bookmark, bookmarks_) { + for (const auto& bookmark : bookmarks_) { storage->addRoom(bookmark.toStorage()); } |