mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 05:22:31 -04:00
turned some std::list<PeerId> into std::set, as it automatically prevents duplicates
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8138 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
f1309a8cbe
commit
c9d5c7b3cb
51 changed files with 269 additions and 266 deletions
|
@ -2089,10 +2089,10 @@ bool p3PeerMgrIMPL::assignPeersToGroup(const std::string &groupId, const std::li
|
|||
|
||||
std::list<RsPgpId>::const_iterator peerIt;
|
||||
for (peerIt = peerIds.begin(); peerIt != peerIds.end(); ++peerIt) {
|
||||
std::list<RsPgpId>::iterator peerIt1 = std::find(groupItem->pgpList.ids.begin(), groupItem->pgpList.ids.end(), *peerIt);
|
||||
std::set<RsPgpId>::iterator peerIt1 = std::find(groupItem->pgpList.ids.begin(), groupItem->pgpList.ids.end(), *peerIt);
|
||||
if (assign) {
|
||||
if (peerIt1 == groupItem->pgpList.ids.end()) {
|
||||
groupItem->pgpList.ids.push_back(*peerIt);
|
||||
groupItem->pgpList.ids.insert(*peerIt);
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue