mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-10 10:34:56 +02:00
use more efficient iterate and clear for removal
This commit is contained in:
parent
adac872a11
commit
a50e55b83a
1 changed files with 4 additions and 4 deletions
|
@ -436,9 +436,9 @@ void AvatarHashMap::sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& ol
|
|||
void AvatarHashMap::clearOtherAvatars() {
|
||||
QWriteLocker locker(&_hashLock);
|
||||
|
||||
AvatarHash::iterator avatarIterator = _avatarHash.begin();
|
||||
while (avatarIterator != _avatarHash.end()) {
|
||||
handleRemovedAvatar(*avatarIterator);
|
||||
avatarIterator = _avatarHash.erase(avatarIterator);
|
||||
for (auto& av : _avatarHash) {
|
||||
handleRemovedAvatar(av);
|
||||
}
|
||||
|
||||
_avatarHash.clear();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue