From: bert hubert Date: Tue, 1 Dec 2015 14:31:24 +0000 (+0100) Subject: it is that kind of day. Or one of those days. X-Git-Tag: dnsdist-1.0.0-alpha1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5f96ff1298f598c4ec67798a6e5c61dfcdbaeef;p=thirdparty%2Fpdns.git it is that kind of day. Or one of those days. --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 570ff4a66f..83d1d2696e 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -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 const char* addS(const C& c) +{ + auto siz = c.size(); + if(!siz || siz > 1) + return "s"; + else return ""; +}