From: Otto Moerbeek Date: Tue, 19 Nov 2019 09:03:17 +0000 (+0100) Subject: Avoid looking up an entry twice by using a ref. X-Git-Tag: dnsdist-1.4.0^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8525%2Fhead;p=thirdparty%2Fpdns.git Avoid looking up an entry twice by using a ref. --- diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 1270452109..0336870c0e 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -239,8 +239,9 @@ public: typename cont_t::iterator i = d_cont.find(t); if (i == d_cont.end()) { - d_cont[t].value = 1; - d_cont[t].last = now.tv_sec; + auto &r = d_cont[t]; + r.value = 1; + r.last = now.tv_sec; return 1; } else {