]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
avoid unnecessary SBuf copies
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 25 Feb 2016 16:43:21 +0000 (17:43 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 25 Feb 2016 16:43:21 +0000 (17:43 +0100)
src/acl/HttpHeaderData.cc
src/acl/Note.cc
src/adaptation/Iterator.cc
src/mgr/ActionParams.cc

index db1fbd22e8d753ca6b4a2c51a9052a0e4028bbb1..2903eb9f361e5179cf82af010da7df7e2595a4d2 100644 (file)
@@ -52,7 +52,7 @@ ACLHTTPHeaderData::match(HttpHeader* hdr)
             return false;
     }
 
-    SBuf cvalue(StringToSBuf(value));
+    auto cvalue = StringToSBuf(value);
     return regex_rule->match(cvalue.c_str());
 }
 
index 50f666e420e60c0577924f12c6754197b6828137..35e43318f41b270e91707c8e11851658be20029b 100644 (file)
@@ -37,7 +37,7 @@ ACLNoteStrategy::matchNotes(ACLData<MatchType> *noteData, const NotePairs *note,
     for (auto &entry: note->entries) {
         if (delimiters) {
             NotePairs::Entry e(entry->name.termedBuf(), "");
-            Parser::Tokenizer t(SBuf(StringToSBuf(entry->value)));
+            Parser::Tokenizer t(StringToSBuf(entry->value));
             SBuf s;
             while (t.token(s, *delimiters)) {
                 e.value = s.c_str();
index 37bce3483d3db9c8ef7f4ead2a1a84d1de973f81..7cfa060f8fe92c58ab84b7e488241e89e1c5e10c 100644 (file)
@@ -63,7 +63,7 @@ void Adaptation::Iterator::start()
             request = theCause;
         Must(request);
         Adaptation::History::Pointer ah = request->adaptHistory(true);
-        SBuf gid(StringToSBuf(theGroup->id));
+        auto gid = StringToSBuf(theGroup->id);
         ah->recordAdaptationService(gid);
     }
 
@@ -103,7 +103,7 @@ void Adaptation::Iterator::step()
 
     if (Adaptation::Config::needHistory) {
         Adaptation::History::Pointer ah = request->adaptHistory(true);
-        SBuf uid(StringToSBuf(thePlan.current()->cfg().key));
+        auto uid = StringToSBuf(thePlan.current()->cfg().key);
         ah->recordAdaptationService(uid);
     }
 
index 6488a06218f987791e719f7a87b59780e4f74beb..7cf84217146d87cf5fa209d25cc9b537a76e2854 100644 (file)
@@ -39,7 +39,7 @@ void
 Mgr::ActionParams::pack(Ipc::TypedMsgHdr &msg) const
 {
     msg.putString(httpUri);
-    String foo(SBufToString(httpMethod.image()));
+    auto foo = SBufToString(httpMethod.image());
     msg.putString(foo);
     msg.putPod(httpFlags);
     msg.putString(httpOrigin);