]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Avoid looking up an entry twice by using a ref. 8525/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 19 Nov 2019 09:03:17 +0000 (10:03 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 19 Nov 2019 09:03:17 +0000 (10:03 +0100)
pdns/syncres.hh

index 127045210943e79b59ba30533bede5c633cb64c4..0336870c0e7f1dbc915f51fe190d317c4934eeb1 100644 (file)
@@ -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 {