From d87d04eb1ec1b8ea5add76a51dacee98d85c59f4 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Thu, 15 Aug 2024 14:56:00 +0200 Subject: [PATCH] config_path(): return a reference --- cpp/include/kvikio/cufile_config.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/include/kvikio/cufile_config.hpp b/cpp/include/kvikio/cufile_config.hpp index bfffb1eb05..85d6cf57ed 100644 --- a/cpp/include/kvikio/cufile_config.hpp +++ b/cpp/include/kvikio/cufile_config.hpp @@ -22,12 +22,12 @@ namespace kvikio { namespace detail { -[[nodiscard]] inline const std::string lookup_config_path() +[[nodiscard]] inline const char* lookup_config_path() { const char* env = std::getenv("CUFILE_ENV_PATH_JSON"); if (env != nullptr && std::filesystem::exists(env)) { return env; } if (std::filesystem::exists("/etc/cufile.json")) { return "/etc/cufile.json"; } - return std::string(); + return ""; } } // namespace detail @@ -39,7 +39,7 @@ namespace detail { * * @return The filepath to the cufile.json file or the empty string if it isn't found. */ -[[nodiscard]] inline const std::string config_path() +[[nodiscard]] inline const std::string& config_path() { static const std::string ret = detail::lookup_config_path(); return ret;