From 4d661e3a92b09362d4749af24e1cac79071adcfb Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 6 Mar 2024 15:57:27 -0500 Subject: cmMakefile: Reduce GetModulesFile caller allocations --- Source/cmMakefile.cxx | 4 ++-- Source/cmMakefile.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bd24f83..ba9fab5 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3906,8 +3906,8 @@ void cmMakefile::DisplayStatus(const std::string& message, float s) const #endif } -std::string cmMakefile::GetModulesFile(const std::string& filename, - bool& system, bool debug, +std::string cmMakefile::GetModulesFile(cm::string_view filename, bool& system, + bool debug, std::string& debugBuffer) const { std::string result; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index e5edbae..ea0b4c6 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -803,7 +803,7 @@ public: /** * Return a location of a file in cmake or custom modules directory */ - std::string GetModulesFile(const std::string& name) const + std::string GetModulesFile(cm::string_view name) const { bool system; std::string debugBuffer; @@ -813,13 +813,13 @@ public: /** * Return a location of a file in cmake or custom modules directory */ - std::string GetModulesFile(const std::string& name, bool& system) const + std::string GetModulesFile(cm::string_view name, bool& system) const { std::string debugBuffer; return this->GetModulesFile(name, system, false, debugBuffer); } - std::string GetModulesFile(const std::string& name, bool& system, bool debug, + std::string GetModulesFile(cm::string_view name, bool& system, bool debug, std::string& debugBuffer) const; //! Set/Get a property of this directory -- cgit v0.12