From d13761f107685fdb65114d9857b57cfdf008ed46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 7 Feb 2021 21:37:16 +0100 Subject: Avoid clang warning about typeid dereferencing pointer --- src/network.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/network.cpp') 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"); } -- cgit v1.2.3