summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-02-07 21:37:16 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2021-02-07 21:37:16 +0100
commitd13761f107685fdb65114d9857b57cfdf008ed46 (patch)
tree0f0d880c21b3eda71b396b599e4877658f409944
parentc2892f82e1d4d5ed046f4ee9cf1955bb97f27021 (diff)
Avoid clang warning about typeid dereferencing pointer
-rw-r--r--src/network.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/network.cpp b/src/network.cpp
index 9081b18..74783b4 100644
--- a/src/network.cpp
+++ b/src/network.cpp
@@ -45,9 +45,11 @@ const Identity & Server::identity() const
Service & Server::svcHelper(const std::type_info & tinfo)
{
- for (auto & s : p->services)
- if (typeid(*s) == tinfo)
- return *s;
+ for (auto & s : p->services) {
+ auto & sobj = *s;
+ if (typeid(sobj) == tinfo)
+ return sobj;
+ }
throw runtime_error("service not found");
}