diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-09-05 18:34:58 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2017-09-05 18:34:58 +0900 |
commit | c0bd6c511b54eb9154e8f42427a62f5ac202cb4a (patch) | |
tree | 0f99cc3c5ded79d3e77cd4757bfb8cbfc0e6f202 /room.cpp | |
parent | 59acb4e7eafb346cf76f086aba229a5ba9d8f1b2 (diff) | |
download | libquotient-c0bd6c511b54eb9154e8f42427a62f5ac202cb4a.tar.gz libquotient-c0bd6c511b54eb9154e8f42427a62f5ac202cb4a.zip |
Room: memberCount(); slight optimization and reformatting
Diffstat (limited to 'room.cpp')
-rw-r--r-- | room.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -371,16 +371,20 @@ QList< User* > Room::users() const return d->membersMap.values(); } -QStringList Room::memberNames() const { +QStringList Room::memberNames() const +{ QStringList res; - - for (auto u : d->membersMap.values()) { + for (auto u : d->membersMap) res.append( this->roomMembername(u) ); - } return res; } +int Room::memberCount() const +{ + return d->membersMap.size(); +} + void Room::Private::insertMemberIntoMap(User *u) { auto namesakes = membersMap.values(u->name()); |