From: Amos Jeffries Date: Sat, 1 Aug 2009 10:04:03 +0000 (+1200) Subject: Author: Alex Rousskov X-Git-Tag: SQUID_3_1_0_13~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8482849bc21a1d83645d4052d1620af990497d7;p=thirdparty%2Fsquid.git Author: Alex Rousskov 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; }