From: Alex Rousskov Date: Mon, 27 Jul 2009 01:51:24 +0000 (-0600) Subject: Polished r9854 "crash on shutdown" changes by removing explicit String X-Git-Tag: SQUID_3_2_0_1~835 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fcb2113ac4565c0ef2d056a163024e20fa43fdf;p=thirdparty%2Fsquid.git Polished r9854 "crash on shutdown" changes by removing explicit String creation. It should be sufficient to just declare TheNullServices as a constant C string. When a C string constant is in use, the code becomes less efficient, but this will be solved when we can go back to using a String class. --- diff --git a/src/adaptation/History.cc b/src/adaptation/History.cc index e7598dd4cd..18f0d7bf48 100644 --- a/src/adaptation/History.cc +++ b/src/adaptation/History.cc @@ -33,7 +33,7 @@ int Adaptation::History::Entry::rptm() } -Adaptation::History::History(): theNextServices(String(TheNullServices)) { +Adaptation::History::History(): theNextServices(TheNullServices) { } int Adaptation::History::recordXactStart(const String &sid, const timeval &when, bool retrying) @@ -120,19 +120,19 @@ bool Adaptation::History::getXxRecord(String &name, String &value) const void Adaptation::History::updateNextServices(const String &services) { - if (theNextServices != String(TheNullServices)) + if (theNextServices != TheNullServices) debugs(93,3, HERE << "old services: " << theNextServices); debugs(93,3, HERE << "new services: " << services); - Must(services != String(TheNullServices)); + Must(services != TheNullServices); theNextServices = services; } bool Adaptation::History::extractNextServices(String &value) { - if (theNextServices == String(TheNullServices)) + if (theNextServices == TheNullServices) return false; value = theNextServices; - theNextServices = String(TheNullServices); // prevents resetting the plan twice + theNextServices = TheNullServices; // prevents resetting the plan twice return true; }