diff options
author | Chris Robinson <[email protected]> | 2020-12-27 06:43:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-12-27 06:43:59 -0800 |
commit | 4c0f77c13e5e38b6fb4c4e2746a6f1adf373f290 (patch) | |
tree | bd6cd5fa362961b2d13d0afa7468cf00dc14feb6 /common/strutils.cpp | |
parent | 7833cfa8de1908710ac613ed4198f246ff0945db (diff) |
Remove some unnecessary constructors
Diffstat (limited to 'common/strutils.cpp')
-rw-r--r-- | common/strutils.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/strutils.cpp b/common/strutils.cpp index 870a0ed3..18c4947a 100644 --- a/common/strutils.cpp +++ b/common/strutils.cpp @@ -46,7 +46,8 @@ namespace al { al::optional<std::string> getenv(const char *envname) { const char *str{std::getenv(envname)}; - if(str && str[0] != '\0') return str; + if(str && str[0] != '\0') + return al::make_optional<std::string>(str); return al::nullopt; } @@ -54,7 +55,8 @@ al::optional<std::string> getenv(const char *envname) al::optional<std::wstring> getenv(const WCHAR *envname) { const WCHAR *str{_wgetenv(envname)}; - if(str && str[0] != L'\0') return str; + if(str && str[0] != L'\0') + return al::make_optional<std::wstring>(str); return al::nullopt; } #endif |