aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-22 20:00:00 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-06-22 20:44:35 +0200
commit796d78dccef1a32e35f7d24feb83cd846c55e2d2 (patch)
tree2d3bde1dda36a7b737af3f5e33b29ac3cae00122 /lib
parent6a7e4f883ec22ef26c1d10ba1544b0afd1a0f4d2 (diff)
downloadlibquotient-796d78dccef1a32e35f7d24feb83cd846c55e2d2.tar.gz
libquotient-796d78dccef1a32e35f7d24feb83cd846c55e2d2.zip
RoomSummary::merge(): explicitly cast between int and bool
Honestly, it was quite intuitive even without that, but in reality there are implicit conversion under the wraps. This commit makes them explicit, for clarity.
Diffstat (limited to 'lib')
-rw-r--r--lib/syncdata.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/syncdata.cpp b/lib/syncdata.cpp
index ff3dc0c2..93416bc4 100644
--- a/lib/syncdata.cpp
+++ b/lib/syncdata.cpp
@@ -18,9 +18,10 @@ bool RoomSummary::isEmpty() const
bool RoomSummary::merge(const RoomSummary& other)
{
// Using bitwise OR to prevent computation shortcut.
- return joinedMemberCount.merge(other.joinedMemberCount)
- | invitedMemberCount.merge(other.invitedMemberCount)
- | heroes.merge(other.heroes);
+ return static_cast<bool>(
+ static_cast<int>(joinedMemberCount.merge(other.joinedMemberCount))
+ | static_cast<int>(invitedMemberCount.merge(other.invitedMemberCount))
+ | static_cast<int>(heroes.merge(other.heroes)));
}
QDebug Quotient::operator<<(QDebug dbg, const RoomSummary& rs)