]> granicus.if.org Git - icinga2/commitdiff
Fix move assignment operator for the String class
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 1 Sep 2016 13:25:14 +0000 (15:25 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 1 Sep 2016 13:25:14 +0000 (15:25 +0200)
fixes #12619

lib/base/string.cpp

index 4474e4d6bde1056ed967111baabbca28dcb566dc..e8b9dbfe36bd0d8aa4b52676da27553f08e884be 100644 (file)
@@ -38,10 +38,8 @@ String::String(Value&& other)
 
 String& String::operator=(Value&& other)
 {
-       const String *p = other.GetPtr<String>();
-
-       if (p)
-               m_Data = std::move(p->m_Data);
+       if (other.IsString())
+               m_Data = std::move(other.Get<String>());
        else
                m_Data = other;