]> git.sesse.net Git - casparcg/blobdiff - core/producer/stage.cpp
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / stage.cpp
index 8262b6ebeaa767e7823f587f64c478035bf0699c..6c7816ba91d345de3c42f583f86efb1fcf3e0759 100644 (file)
@@ -159,7 +159,7 @@ public:
        {\r
                channel_.execution().invoke([&]\r
                {\r
-                       layers_[index].swap(layers_[other_index]);\r
+                       std::swap(layers_[index], layers_[other_index]);\r
                }, high_priority);\r
        }\r
 \r
@@ -169,7 +169,10 @@ public:
                        swap_layer(index, other_index);\r
                else\r
                {\r
-                       auto func = [&]{layers_[index].swap(other.impl_->layers_[other_index]);};               \r
+                       auto func = [&]\r
+                       {\r
+                               std::swap(layers_[index], other.impl_->layers_[other_index]);\r
+                       };              \r
                        channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
                }\r
        }\r
@@ -181,19 +184,9 @@ public:
                \r
                auto func = [&]\r
                {\r
-                       auto sel_first = [](const std::pair<int, layer>& pair){return pair.first;};\r
-\r
-                       std::set<int> indices;\r
-                       auto inserter = std::inserter(indices, indices.begin());\r
-\r
-                       std::transform(layers_.begin(), layers_.end(), inserter, sel_first);\r
-                       std::transform(other.impl_->layers_.begin(), other.impl_->layers_.end(), inserter, sel_first);\r
-\r
-                       BOOST_FOREACH(auto index, indices)\r
-                               layers_[index].swap(other.impl_->layers_[index]);\r
-               };\r
-               \r
-               channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);});\r
+                       std::swap(layers_, other.impl_->layers_);\r
+               };              \r
+               channel_.execution().invoke([&]{other.impl_->channel_.execution().invoke(func, high_priority);}, high_priority);\r
        }\r
 \r
        layer_status get_status(int index)\r