aboutsummaryrefslogtreecommitdiff
path: root/room.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-05 18:34:58 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-09-05 18:34:58 +0900
commitc0bd6c511b54eb9154e8f42427a62f5ac202cb4a (patch)
tree0f99cc3c5ded79d3e77cd4757bfb8cbfc0e6f202 /room.cpp
parent59acb4e7eafb346cf76f086aba229a5ba9d8f1b2 (diff)
downloadlibquotient-c0bd6c511b54eb9154e8f42427a62f5ac202cb4a.tar.gz
libquotient-c0bd6c511b54eb9154e8f42427a62f5ac202cb4a.zip
Room: memberCount(); slight optimization and reformatting
Diffstat (limited to 'room.cpp')
-rw-r--r--room.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/room.cpp b/room.cpp
index 992411c0..547b74c4 100644
--- a/room.cpp
+++ b/room.cpp
@@ -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());