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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f5f96ff1298f598c4ec67798a6e5c61dfcdbaeef;p=pdns it is that kind of day. Or one of those days. --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 570ff4a66..83d1d2696 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 ""; +}