From: Alex Rousskov Date: Thu, 1 Jul 2010 22:01:14 +0000 (-0600) Subject: Optimization: Format "kidN" label for debugging once because it never changes X-Git-Tag: SQUID_3_2_0_1~93^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b3dc6ecc847fff3489d46987fdd529dd180ddbf;p=thirdparty%2Fsquid.git Optimization: Format "kidN" label for debugging once because it never changes after KidIdentifier is set. --- diff --git a/src/debug.cc b/src/debug.cc index 41b4907ad4..edcaf70120 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -551,7 +551,8 @@ debugLogKid(void) { if (KidIdentifier != 0) { static char buf[16]; - snprintf(buf, sizeof(buf), " kid%d", KidIdentifier); + if (!*buf) // optimization: fill only once after KidIdentifier is set + snprintf(buf, sizeof(buf), " kid%d", KidIdentifier); return buf; }