]> granicus.if.org Git - pdns/commitdiff
it is that kind of day. Or one of those days.
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 1 Dec 2015 14:31:24 +0000 (15:31 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 1 Dec 2015 14:31:24 +0000 (15:31 +0100)
pdns/misc.hh

index 570ff4a66fd21fd33a494ad9e92de54bd3b49956..83d1d2696e2752dcc2f71a2293cf129985e15430 100644 (file)
@@ -650,3 +650,12 @@ T valueOrEmpty(const P val) {
   if (!val) return T{};
   return T(val);
 }
+
+// I'm not very OCD, but I appreciate loglines like "processing 1 delta", "processing 2 deltas" :-)
+template<typename C> const char* addS(const C& c)
+{
+  auto siz = c.size();
+  if(!siz || siz > 1)
+    return "s";
+  else return "";
+}