diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2021-02-07 21:37:16 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2021-02-07 21:37:16 +0100 |
commit | d13761f107685fdb65114d9857b57cfdf008ed46 (patch) | |
tree | 0f0d880c21b3eda71b396b599e4877658f409944 /src | |
parent | c2892f82e1d4d5ed046f4ee9cf1955bb97f27021 (diff) |
Avoid clang warning about typeid dereferencing pointer
Diffstat (limited to 'src')
-rw-r--r-- | src/network.cpp | 8 |
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"); } |