From 255b6f979d4ce1769db51b1822049563c9520a53 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Fri, 23 Jul 2021 15:41:22 +0100 Subject: [PATCH] Revise emplace_back() to push_back() and fix Mac clang complaint. In both cases we have a created object we want to move onto the vector. Mac's clang objects to the first std::move() as it's applied to a temporary and disables copy elision. --- react_juce/core/EcmascriptEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react_juce/core/EcmascriptEngine.cpp b/react_juce/core/EcmascriptEngine.cpp index f24059fb..d0c97abf 100644 --- a/react_juce/core/EcmascriptEngine.cpp +++ b/react_juce/core/EcmascriptEngine.cpp @@ -153,7 +153,7 @@ namespace reactjuce { if (!i.isString()) return false; - sources.emplace_back(std::move(i.toString())); + sources.push_back(i.toString()); } bool firstSegmentInLine = true; @@ -182,7 +182,7 @@ namespace reactjuce if (*p == ';') { - mappings.emplace_back(std::move(lineSegments)); + mappings.push_back(std::move(lineSegments)); firstSegmentInLine = true; } }