From: bert hubert Date: Tue, 1 Dec 2015 16:36:02 +0000 (+0100) Subject: after some further bikeshedding.. X-Git-Tag: dnsdist-1.0.0-alpha1~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88bf32790fc7c9f8ca2fda92f72798ef21d56e59;p=thirdparty%2Fpdns.git after some further bikeshedding.. --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 83d1d2696e..0e5a0123da 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -651,11 +652,19 @@ T valueOrEmpty(const P val) { 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) +template +const char* addS(Integer siz, typename std::enable_if::value>::type*P=0) { - auto siz = c.size(); if(!siz || siz > 1) return "s"; else return ""; } + +template +const char* addS(const C& c, typename std::enable_if::value>::type*P=0) +{ + return addS(c.size()); +} +