From 4f3422c58ed4fc14b222cd474843affb9cc509c4 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 9 Dec 2024 20:02:33 +0100 Subject: Various clang-tidy fixes. --- src/bootstrap.cc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/bootstrap.cc') diff --git a/src/bootstrap.cc b/src/bootstrap.cc index 55bd3e0..45ecad4 100644 --- a/src/bootstrap.cc +++ b/src/bootstrap.cc @@ -42,33 +42,38 @@ bool ctor::configuration::has(const std::string& key) const const std::string& ctor::configuration::get(const std::string& key, const std::string& default_value) const { - if(key == ctor::cfg::build_cxx && std::getenv("CXX")) + auto cxx_env = std::getenv("CXX"); + if(key == ctor::cfg::build_cxx && cxx_env) { - static std::string s = std::getenv("CXX"); + static std::string s = cxx_env; return s; } - if(key == ctor::cfg::build_cc && std::getenv("CC")) + auto cc_env = std::getenv("CC"); + if(key == ctor::cfg::build_cc && cc_env) { - static std::string s = std::getenv("CC"); + static std::string s = cc_env; return s; } - if(key == ctor::cfg::build_ld && std::getenv("LD")) + auto ld_env = std::getenv("LD"); + if(key == ctor::cfg::build_ld && ld_env) { - static std::string s = std::getenv("LD"); + static std::string s = ld_env; return s; } - if(key == ctor::cfg::build_ar && std::getenv("AR")) + auto ar_env = std::getenv("AR"); + if(key == ctor::cfg::build_ar && ar_env) { - static std::string s = std::getenv("AR"); + static std::string s = ar_env; return s; } - if(key == ctor::cfg::builddir && std::getenv("BUILDDIR")) + auto builddir_env = std::getenv("BUILDDIR"); + if(key == ctor::cfg::builddir && builddir_env) { - static std::string s = std::getenv("BUILDDIR"); + static std::string s = builddir_env; return s; } -- cgit v1.2.3