diff options
author | zimbatm <zimbatm@zimbatm.com> | 2023-03-03 11:34:36 +0100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2023-03-03 11:34:36 +0100 |
commit | dc8820c71f841df49568099bf3889c7cfb2d92a9 (patch) | |
tree | 619d96983af87e6673abd4b07fef04c728c6916e | |
parent | b96d9c1687066045ce1a045798b64e914cc51fd4 (diff) |
fixup: use same style as getEnv
-rw-r--r-- | src/libutil/util.cc | 7 |
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() |