]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Avoid looking up an entry twice by using a ref. 8552/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:53:24 +0000 (10:53 +0100)
(cherry picked from commit 3eba27418a7102a82777b74bd199943b67a93a6e)

pdns/syncres.hh

index aa26649abc5ffaa863a27301df69928097e1d22b..4ead6cb18ef00387197d1120313680c48c99fa31 100644 (file)
@@ -237,8 +237,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 {