]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add move semantics to String class
authorAmos Jeffries <>
Sat, 1 Apr 2017 16:46:01 +0000 (04:46 +1200)
committerAmos Jeffries <>
Sat, 1 Apr 2017 16:46:01 +0000 (04:46 +1200)
Improves speed in several common header code paths using String.

Detected by Coverity Scan. Issue 1364732.

src/SquidString.h

index 909020ccd38116beb6f88e55491d3c89ef39fdbe..034b79ddf23775a155c5c3a1cf56674a19eee8ed 100644 (file)
@@ -28,6 +28,7 @@ public:
     String();
     String(char const *);
     String(String const &);
+    String(String &&) = default;
     ~String();
 
     typedef size_t size_type; //storage size intentionally unspecified
@@ -35,6 +36,7 @@ public:
 
     String &operator =(char const *);
     String &operator =(String const &);
+    String &operator =(String &&) = default;
     bool operator ==(String const &) const;
     bool operator !=(String const &) const;