From dc6c57ce0d4f5424bfb047c51fee18eac381a98b Mon Sep 17 00:00:00 2001 From: Jason Safaiyeh Date: Wed, 12 Feb 2020 23:47:15 -0800 Subject: [PATCH] Resolve React-cxxreact warnings (#28047) Summary: Resolve Xcode warnings from React-cxxreact. ## Changelog [iOS] [Fixed] - Resolve Xcode warnings from React-cxxreact. Pull Request resolved: https://github.com/facebook/react-native/pull/28047 Test Plan: React-cxxreact should no longer throw `... creates a copy from type...` warnings Differential Revision: D19874043 Pulled By: hramos fbshipit-source-id: 15a4a810adee268e6ede459d6d4917ccfa83c157 --- ReactCommon/cxxreact/JSDeltaBundleClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactCommon/cxxreact/JSDeltaBundleClient.cpp b/ReactCommon/cxxreact/JSDeltaBundleClient.cpp index 71e894fa65b535..3f3e01add36442 100644 --- a/ReactCommon/cxxreact/JSDeltaBundleClient.cpp +++ b/ReactCommon/cxxreact/JSDeltaBundleClient.cpp @@ -28,7 +28,7 @@ std::string startupCode(const folly::dynamic *pre, const folly::dynamic *post) { } // namespace void JSDeltaBundleClient::patchModules(const folly::dynamic *modules) { - for (const folly::dynamic pair : *modules) { + for (const folly::dynamic &pair : *modules) { auto id = pair[0].getInt(); auto module = pair[1]; modules_[id] = std::move(module.getString()); @@ -53,7 +53,7 @@ void JSDeltaBundleClient::patch(const folly::dynamic &delta) { } else { const folly::dynamic *deleted = delta.get_ptr("deleted"); if (deleted != nullptr) { - for (const folly::dynamic id : *deleted) { + for (const folly::dynamic &id : *deleted) { modules_.erase(id.getInt()); } }