aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libutil/util.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index b70723634..c0b8f77b0 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -56,11 +56,8 @@ std::optional<std::string> getEnv(const std::string & key)
std::optional<std::string> getEnvNonEmpty(const std::string & key) {
auto value = getEnv(key);
- if (value == "") {
- return std::nullopt;
- } else {
- return value;
- }
+ if (value == "") return {};
+ return value;
}
std::map<std::string, std::string> getEnv()