diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-09 20:02:33 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-12-09 20:28:00 +0100 |
commit | 4f3422c58ed4fc14b222cd474843affb9cc509c4 (patch) | |
tree | 5d6079f5309fabf553119fad5b01779c6a8097d0 /src/bootstrap.cc | |
parent | 5ba36c7be0a12b9b052fb172a209d3b6dffc9a99 (diff) |
Various clang-tidy fixes.
Diffstat (limited to 'src/bootstrap.cc')
-rw-r--r-- | src/bootstrap.cc | 25 |
1 files changed, 15 insertions, 10 deletions
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; } |