From d8482849bc21a1d83645d4052d1620af990497d7 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 1 Aug 2009 22:04:03 +1200 Subject: [PATCH] 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. --- src/adaptation/History.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.47.3