]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polished r9854 "crash on shutdown" changes by removing explicit String
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 27 Jul 2009 01:51:24 +0000 (19:51 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 27 Jul 2009 01:51:24 +0000 (19:51 -0600)
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.

src/adaptation/History.cc

index e7598dd4cddf2d20314cb045b68dfef08c8a52fc..18f0d7bf48d3b00cab3b0ac624d8d278eea737e8 100644 (file)
@@ -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;
 }