[icinga-checkins] icinga.org: icinga2/master: Remove even more unnecessary copies

git at icinga.org git at icinga.org
Sat Aug 27 20:41:01 CEST 2016


Module: icinga2
Branch: master
Commit: ed72112d4bf2b6f0af5859c645caf0cbbb007332
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=ed72112d4bf2b6f0af5859c645caf0cbbb007332

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Aug 27 20:37:25 2016 +0200

Remove even more unnecessary copies

refs #12509

---

 lib/base/dictionary.cpp |    2 +-
 lib/base/value.hpp      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/base/dictionary.cpp b/lib/base/dictionary.cpp
index e44cca1..e3b348f 100644
--- a/lib/base/dictionary.cpp
+++ b/lib/base/dictionary.cpp
@@ -88,7 +88,7 @@ void Dictionary::Set(const String& key, Value&& value)
 {
 	ObjectLock olock(this);
 
-	m_Data[key].Swap(value);
+	m_Data[key] = std::move(value);
 }
 
 /**
diff --git a/lib/base/value.hpp b/lib/base/value.hpp
index 56fed2c..476f7b1 100644
--- a/lib/base/value.hpp
+++ b/lib/base/value.hpp
@@ -256,7 +256,7 @@ public:
 		if (!IsObject())
 			return false;
 
-		return (dynamic_pointer_cast<T>(boost::get<Object::Ptr>(m_Value)) != NULL);
+		return (dynamic_cast<T *>(boost::get<Object::Ptr>(m_Value).get()) != NULL);
 	}
 
 	/**



More information about the icinga-checkins mailing list