From 4d0deb26e9b5efc33a20b50502084f215d3b39a2 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Fri, 3 Jun 2022 11:49:40 +0200 Subject: pass by const ref big objects --- src/buildtool/main/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index a2af1fe6..1a213d28 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -429,9 +429,9 @@ void DetectAndReportPending(std::string const& name, } // returns FileRoot and optional local path, if the root is local -auto ParseRoot(nlohmann::json desc, - const std::string& repo, - const std::string& keyword) +auto ParseRoot(nlohmann::json const& desc, + std::string const& repo, + std::string const& keyword) -> std::pair> { nlohmann::json root = desc[keyword]; if ((not root.is_array()) or root.empty()) { @@ -487,7 +487,8 @@ auto ParseRoot(nlohmann::json desc, // Set all roots and name mappings from the command-line arguments and // return the name of the main repository and main workspace path if local. -auto DetermineRoots(CommonArguments cargs, AnalysisArguments aargs) +auto DetermineRoots(CommonArguments const& cargs, + AnalysisArguments const& aargs) -> std::pair> { std::optional main_ws_root; auto repo_config = nlohmann::json::object(); -- cgit v1.2.3